ng2-ui / datetime-picker

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

date-format doesn't work with banana in the box #19

Closed visitek closed 7 years ago

visitek commented 7 years ago
<input #fromInput datetime-picker
        [(ngModel)]="from"
        close-on-select="false"
        date-format="DD.MM.YYYY HH:mm"
>

while from value (ISO string) is changed in component, date-format is not applied and input contain ISO 2016-09-13T16:50:46Z instead of 13.09.2016 16:50

I should note that initialization and changing value from datepicker works fine. Only external changes don't touch formatting.

Probably bug

allenhwkim commented 7 years ago

Only external changes don't touch formatting.. Can you be more specific, or a plnuker?

visitek commented 7 years ago

yes, we should imlement OnChanges.. Directive does not know about @Input changes now

visitek commented 7 years ago

OnInit is not enough because picker could be already initialized while external event changes ngModel value. hm?

visitek commented 7 years ago

This component is not interactive now.. e.g.: We have DND area with setting time and opened datepicker should react on changes emmited by dnd. This is right banana in the box functionality in my opinion :)

visitek commented 7 years ago

Why do you use setTimeout? Ng2 has AfterViewInit and AfterViewCheck.. This module should be completely rewritten :cry:

allenhwkim commented 7 years ago

I heard. Could you make PR for it?

Sent from my iPhone

On Sep 13, 2016, at 9:54 AM, Martin Lonský notifications@github.com wrote:

Why do you use setTimeout? Ng2 has AfterViewInit and AfterViewCheck.. This module should be completely rewritten :(

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

visitek commented 7 years ago

We've just forked it and will reimplement some blocks

allenhwkim commented 7 years ago

We always welcome your changes. It has been rewritten version from NG1, https://www.npmjs.com/package/angularjs-datetime-picker, at this moment. It has some angular1 stuff. Please make PR from your forked version, or let me know your repo. I will borrow your codes :)

visitek commented 7 years ago

https://github.com/myappin/ng2-datetime-picker

On Tue, Sep 13, 2016 at 4:14 PM, Allen Kim notifications@github.com wrote:

We always welcome your changes. It has been rewritten version from NG1 at this moment. It has some angular1 stuff. Please make PR from your forked version, or let me know your repo. I will borrow your codes :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ng2-ui/ng2-datetime-picker/issues/19#issuecomment-246695035, or mute the thread https://github.com/notifications/unsubscribe-auth/ABqUD7PLlBmJJMSF9qhi2Gg27n4m0cHrks5qpq_cgaJpZM4J7ibC .

visitek commented 7 years ago

We will create pull request while stable

On Tue, Sep 13, 2016 at 4:20 PM, Martin Lonský martin.lonsky@appin.cz wrote:

https://github.com/myappin/ng2-datetime-picker

On Tue, Sep 13, 2016 at 4:14 PM, Allen Kim notifications@github.com wrote:

We always welcome your changes. It has been rewritten version from NG1 at this moment. It has some angular1 stuff. Please make PR from your forked version, or let me know your repo. I will borrow your codes :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ng2-ui/ng2-datetime-picker/issues/19#issuecomment-246695035, or mute the thread https://github.com/notifications/unsubscribe-auth/ABqUD7PLlBmJJMSF9qhi2Gg27n4m0cHrks5qpq_cgaJpZM4J7ibC .