We have p-calendar with rande mode.
Defined as below:
Code: Select all
<p-calendar selectionMode="range" showButtonBar="true" [showIcon]="true" [defaultDate]="initTransactionDate"
[monthNavigator]="true" [yearNavigator]="true" yearRange="1900:2100"
formControlName="TransactionDateRange" dateFormat="dd.mm.yy" [locale]="defaultLocale" id="calendarRegistrationDate"></p-calendar>
we want to set initial data
Code: Select all
this.fb.group({TransactionDateRange: ["2019-02-11T23:00:00.000Z", "2019-02-12T23:00:00.000Z"]});
we also try to parse string as data:
Code: Select all
this.fb.group({TransactionDateRange: Tue Feb 12 2019 00:00:00 GMT+0100, Wed Feb 13 2019 00:00:00 GMT+0100]});
Could you tell me how to set date range programmatically during initializing reactive form?