ng2-ui/datetime-picker

incorrect time output

zchung opened this issue · 1 comments

I have been getting incorrect time outputs when using the date-format option with moment js in the time-only date-picker element.

If I set the date format to "HH:mm" it seems to gives me the incorrect time but when I use "DD/MM/YYYY hh:mm" it is correct.

correcteventtime
incorrecttime
htmlcode

I have tried other combinations such as "h:mm a" but it always seems to give me the incorrect time. At first I thought it was a timezone issue but my javascript object doesn't have a TZ in it and if that were the case then it would be different times in the output, not the same ones.

Never mind. Should have looked deeper at the source code before posting. The fix is using parse-format="YYYY-MM-DD HH:mm:ss"