Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird format time bug in moment #15

Closed
artknight opened this issue Feb 17, 2016 · 5 comments
Closed

weird format time bug in moment #15

artknight opened this issue Feb 17, 2016 · 5 comments

Comments

@artknight
Copy link
Contributor

<cfset date = new "/dailysandbox/cfc/lib/moment"("02/18/2016 12:10 PM")>
<cfdump var="#date.format("hh:mm tt")#" abort>

I get 12:02 PM and that is wrong.....

@artknight artknight changed the title weird time bug in moment weird format time bug in moment Feb 17, 2016
@atuttle
Copy link
Member

atuttle commented Feb 17, 2016

your format string should be hh:nn tt not hh:mm tt ~ the "mm" is the month, which is why it's 02. :)

@artknight
Copy link
Contributor Author

ah, damn it! you are correct!

@atuttle atuttle closed this as completed Feb 17, 2016
@artknight
Copy link
Contributor Author

Hi, just wondering.. I checked moment.js and they are using "mm" for minutes and "MM" for months. Do you think it would be possible to adjust this component to be fully compatible with the moment syntax?

@atuttle
Copy link
Member

atuttle commented Mar 20, 2016

I don't see an overwhelming case for it. We're not aiming for complete parity with moment.js, and the current implementation is very much in line with dateTimeFormat() masks (in most cases, simply delegating to that method), which makes it familiar for existing CFML developers.

I'm not saying no, I'm saying convince me. ;)

@artknight
Copy link
Contributor Author

Yeah, you are absolutely correct that the format does comply with the CF date/time format. Honestly I am not sure which way is better, but I do tend to put "mm" for months as a force of habbit and can imagine others, having worked with moment.js, will too. So, this would be a pure convenience change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants