I am using the date range in another view in my Angular 2 app. Is there away to default the date range to the last 30 days instead of today? For my use in the particular instance it makes more sense to use last 30 days instead.
5 Answer(s)
-
0
Hi,
You can change it here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/master/angular/src/app/shared/common/timing/date-range-picker.component.ts#L16">https://github.com/aspnetzero/aspnet-ze ... ent.ts#L16</a>.
Thanks.
-
0
I don't want to change it globally though. Just for a specific instance of the date range picker. Is there a way to do that?
-
0
Hi,
Then when you are using dateRangePicker in your component, you can bind any date to it's startDate property.
<date-range-picker [(startDate)]="startDate" [(endDate)]="endDate"></date-range-picker>
Thanks.
-
0
Perfect. I basically did something like this and it worked for me.
public startDate: moment.Moment = moment().subtract(29, 'days').startOf('day'); public endDate: moment.Moment = moment().endOf("day");
Thank you
-
0
Great :)