Datejs parsing several months not working

I am using date-fr-FR.js

When i do this

Date.parse("5 juillet 2012")

      

it returns null

But when I do this

Date.parse("5 juil. 2012")

      

it returns the correct date, does anyone have an idea? Thanks to

+3


source to share


1 answer


Looking at the source fr-FR.js (r191), which is used to generate date-fr-FR.js, it appears to be a bug in the regexes that are used to define months for that particular month:

jul: /^juil(.(let)?)?/i,

      

which means it will work with Date.parse("5 juilXlet 2012")

, Date.parse("5 juil 2012")

and Date.parse("5 juil. 2012")

, but not with Date.parse("5 juillet 2012")

!



I think it should be something like this:

/^juil(\.|(let))?/i

      

Not that it helps you! I suggest that you always use short names if you cannot commit this file.

+3


source







All Articles