Hi,
I am new to ionic framework and trying to use ion-datetime in ionic2.
I have two ion-datetime fields in my page ,one is start date and other is end date to show energy consumption graphs. start date should be set to current month first date(Ex: if current month is june 01-06-2017,if july 01-07-2017 …) and end date should be set to today. I am done with End date,but I am stuck with setting start date as month first date dynamically… Expecting some immediate help.
Thanks in advance!
Hi ,
I tried this approach to get my bug cracked after crushing 6-7 days. In my case, I have to pass the getMinimum value as the minimum time while checking out. So users should not be able to check-out before the check-in time.
.ts File
check_in_value: 2021-12-06T13:15:11.684Z
const a = parseISO(check_in_value);
const b = addHours(new Date(a),5);
this.getMinimum = b.toISOString()
concole.log(this.getMinimum)
HTML File
<ion-datetime
displayFormat=“YYYY-MM-DD HH:mm”
pickerFormat=“YYYY-MM-DD HH:mm”
[value]=“check_out”
[min]=“getMinimum”