Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting default Date Range #36

Open
anikets43 opened this issue Sep 16, 2017 · 2 comments
Open

Setting default Date Range #36

anikets43 opened this issue Sep 16, 2017 · 2 comments

Comments

@anikets43
Copy link

Hi @jkuri

Is there any option to set default date?

<ng-daterangepicker [(ngModel)]="dateValue" [options]="options"></ng-daterangepicker>

dateValue: '2017/09/05-2017/09/17';

 this.options = {
      theme: 'default',
      range: 'tw',
      dayNames: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
      presetNames: ['This Month', 'Last Month', 'This Week', 'Last Week', 'This Year', 'Last Year', 'From', 'End'],
      dateFormat: 'yMd',
      outputFormat: 'YYYY/MM/DD',
      startOfWeek: 1
    };
@jkuri
Copy link
Owner

jkuri commented Sep 16, 2017

hi @anikets43, I checked and something like that should work, check https://github.com/jkuri/ng-daterangepicker/blob/master/src/ng-daterangepicker/ng-daterangepicker.component.ts#L66-L79 you can see its binded to ngModel.

@dasherzx
Copy link

dasherzx commented Sep 26, 2017

wouldn't this.selectRange(this.options.range); called at ngOnInit override the default date we want to set? At least that's whats happening in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants