Reputation: 541
I have a date with thi format:"YYYY-MM-DD HH:mm:ss" and I'm trying to format that to: "DD/MM/YYYY às HH:mm" So a date like: 2015-01-22 15:01:45 would be formatted to: 22/01/2015 às 15:01
I'm using angular-moment.js to do that, here is what I tried:
amDateFormat:"DD/MM/YYYY 'as' hh:mm"
But the output is not what I was expecting:
22/01/2015 am0 12:00
What am I doing wrong?
Upvotes: 1
Views: 1879
Reputation: 181
You are still using format character in 'as'. 'a' means displaying AM or PM in lowercase format. 's' means displaying seconds.
To achieve what you want, escape the 'as' character. So your format should look like:
amDateFormat:"DD/MM/YYYY [as] hh:mm"
See the reference
I also not sure what 'as' means in Thai, perhaps you also want to check the internationalization part.
Upvotes: 1