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

moment.fn.format with single and double quotes #408

Closed
bytnar opened this issue Aug 22, 2012 · 3 comments
Closed

moment.fn.format with single and double quotes #408

bytnar opened this issue Aug 22, 2012 · 3 comments

Comments

@bytnar
Copy link

bytnar commented Aug 22, 2012

In previous version I was able to do formatting with apostrophe inside like
moment().format("MMM 'YY")
moment().format('MMM 'YY')
With 2.0 version I get

SyntaxError: Unexpected string
arguments: Array[0]
get message: function () { [native code] }
get stack: function () { [native code] }
set message: function () { [native code] }
set stack: function () { [native code] }
type: "unexpected_token_string"
proto: Error

@timrwood
Copy link
Member

Hmm, probably because we switched to a new Function(string) based formatter for better performance. Looks like we're not escaping strings correctly here.

I'll add some tests and this should go in the 1.7.1 release.

timrwood added a commit that referenced this issue Sep 2, 2012
@timrwood
Copy link
Member

timrwood commented Sep 2, 2012

This was fixed when #377 was fixed, and will go out in 1.7.1.

@timrwood
Copy link
Member

timrwood commented Oct 1, 2012

This has been released with 1.7.1. #384

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