ch-gilbert / datejs

Automatically exported from code.google.com/p/datejs
Other
0 stars 0 forks source link

Use of article 'de' breaks format (es, pt, quz) #124

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Format date using standard localization in es-, pt-, or quz- that includes 
the 'de' article (i.e. longDate, monthDay)
2. The d in 'de' is formatted as a single d

What is the expected output? What do you see instead?

Expected: quarta-feira, 8' de 'junho' de '2011
Actual: quarta-feira, 8' 8e 'junho' 8e '2011

What version of the product are you using? On what operating system?

Using latest SVN trunk

Please provide any additional information below.

The issue is with the regex pattern used for replacing tokens, which is:

(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)

Work around

Change regex pattern to:

(\\)?(dd?d?d?(?!e)|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)

Regex for fix can be viewed here: http://rubular.com/r/X9F9G5Xt2M

Original issue reported on code.google.com by erik.ree...@erislogic.com on 8 Jun 2011 at 7:36

GoogleCodeExporter commented 9 years ago
patched in my fork here: https://github.com/abritinthebay/datejs/

Original comment by darkcr...@gmail.com on 19 Sep 2013 at 9:00