ng2-ui / datetime-picker

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

shall we add second to the model while click `Current Time` #181

Closed marrypen closed 7 years ago

marrypen commented 7 years ago

After setting date-format="YYYY-MM-DD hh:mm:ss", the value with second defined in component can be correctly formatted.

But while click Current Time, the value will be formatted to YYYY-MM-DD hh:mm:00. mention that the second is always 00. Are there any specific reasons for this?

allenhwkim commented 7 years ago

@marrypen I have never thought of selecting a second when selecting date/time.

Is there any use case we need to select a second? For current time, yes the second is 00, but it's just we simply did not consider second.

Should we really consider second?

marrypen commented 7 years ago

@allenhwkim

sorry for the late response. And Thanks for the explanation. Forget the selection about second(this is not necessary I think), I was just wondering that we could correctly format date with second but by click current time, we can only get current-time without second.

allenhwkim commented 7 years ago

@marrypen when you click current time, we set hour and minute as the current time without considering second. I do not recommend to consider second for the current time because you have never chosen second, and the moment you clicked is different from the moment you chose. Thus, unless there is clear reason we MUST chose second, I don't think this is a valid concern.

marrypen commented 7 years ago

@allenhwkim ok, got it. thanks again for the explanation.