ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

Unable to set mindate, max date and default date #106

Closed pksatish07 closed 7 years ago

pksatish07 commented 7 years ago

Can you please provide plunker example to set set mindate,max date and default UTC date and time using data binding.

UTC date:

dateObj: any = new Date(); todaysDate: string = new Date(this.dateObj.getUTCFullYear(), this.dateObj.getUTCMonth(), this.dateObj.getUTCDate(), this.dateObj.getUTCHours(), this.dateObj.getUTCMinutes()).toUTCString(); date2 = new Date(this.todaysDate);

This portion of code works in plunker which sets date to UTC but when i use same in my project its setting date to 11-08-0017 but time is setting correct.

allenhwkim commented 7 years ago

This is invalid date11-08-0017

Also the example using min-date and max-date is already in the app directory.

https://github.com/ng2-ui/ng2-datetime-picker/blob/master/app/app.component.ts#L34