ng2-ui / datetime-picker

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

Date is not formatted on initializing #120

Closed Rob-Post closed 7 years ago

Rob-Post commented 7 years ago

See the demo plunkr: https://plnkr.co/edit/su2aiL?p=preview

The third input shows: Thu Jan 01 2015 06:00:00 GMT+0100 (W. Europe Standard Time) In version 0.12.1 it shows: 01-01-2015 06:00

allenhwkim commented 7 years ago

Thanks it has been fixed and released as 0.12.7

Rob-Post commented 7 years ago

Thanks for the new version. I'm not using momentjs and now get an error saying moment is not defined when opening a date picker

allenhwkim commented 7 years ago

date-format should not be used if you don't use momenr

Rob-Post commented 7 years ago

I'm not using date-format.

I've made an example plunkr which gives the same error: https://plnkr.co/edit/35CHLXZo3sLjjQ4sVEBc?p=preview

allenhwkim commented 7 years ago

Someone made a wrong code change, I think. image Fixed and released again 0.12.8

Rob-Post commented 7 years ago

Still the same error

I think only typeofwas missing, but you also swapped the ifand elseblock which is wrong now

allenhwkim commented 7 years ago

Sorry, 5 mins fix didn't go well. 0.12.9 is released again

enheit commented 7 years ago

Well done, now it opens. But when i am trying to select a day it shows another error. core.umd.js?e2a5:3491 EXCEPTION: Error in ./Ng2DatetimePickerComponent class Ng2DatetimePickerComponent - inline template:33:4 caused by: moment is not defined.

allenhwkim commented 7 years ago

:(, there is another bug here. https://github.com/ng2-ui/ng2-datetime-picker/blob/master/src/ng2-datetime-picker.component.ts#L336

I will fix and make a new release.

Rob-Post commented 7 years ago

When using custom formatDate() and parseDate() functions, I now get an error string is not defined

See this plunkr: https://plnkr.co/edit/aBguwmLkmIAD2Y4vA1vJ?p=preview

allenhwkim commented 7 years ago

Your plunker syntax is not correct. https://plnkr.co/edit/2TGRytRM9UHrEuCu5jmg?p=preview