Giter Club home page Giter Club logo

Comments (6)

geoffreymcgill avatar geoffreymcgill commented on July 16, 2024

From @GoogleCodeExporter on April 18, 2015 5:51

I also got this behaviour. And investigated a little bit.

It only occurs when abbreviated month names differ from english (e.g. okt - oct 
and
dez - dec). Can you confirm this?

The problem lies in the parser. Line 520 is a method that returns the month 
number,
which is done by checking for a 3 letter abbreviated month name in the 
cultureinfo.

NOTE: this might give rise to a problem when names are abbreviated in other 
than 3
letters

line 713 defines some months in english (don't know what this line does, but it 
is
relevant). Furthermore, the keys of the regexpatterns in cultureinfo are 
english.

I resolved this bug by doing the following
- changed regexPattern keys to the abbreviated month name keys
- changed line 713 to the following:

g.MMM=g.MMMM=_.cache(_.process(g.ctoken(Date.CultureInfo.abbreviatedMonthNames.j
oin('
')),t.month));

which effectively builds the string from the cultureinfo

NOTE: this is also a problem with day names

Original comment by [email protected] on 28 Nov 2009 at 10:13

from datejs.

geoffreymcgill avatar geoffreymcgill commented on July 16, 2024

From @GoogleCodeExporter on April 18, 2015 5:51

Dear rikkertkoppes,

Thanks for your investigation! Unfortunately I am no JS expert, which leaves me 
a 
bit helpless.

I tried your change, but it does not make any difference, at least not in my 
case. I 
still get the current month when I try e.g. "Dez" for December. And if pattern 
and 
month name contain accented characters ("März") the result is empty thereby 
signalling an error.

What is your environment? I am using IIS 6.0 at the server and IE 7 at the 
workstation. Maybe this is relevant as well.

Best regards,
Dietmar.

Original comment by [email protected] on 30 Nov 2009 at 10:32

from datejs.

geoffreymcgill avatar geoffreymcgill commented on July 16, 2024

From @GoogleCodeExporter on April 18, 2015 5:51

Did you recompile? I doubt so, since you say you are not a js expert.

Which files did you change? If you changed things in the src directory, it 
won't work
instantly. You need to recompile your files.

When you don't know how to do that, you can also adjust your built file in the 
build
directory, it is a bit more messy, but nevermind

- open your language version build file in a text editor, code should look 
really
crammed up.
- locate your cultureInfo and change it there (crammed up at the top);
- locate the following part:

g.MMM=g.MMMM=_.cache(_.process(g.ctoken("jan feb mar apr may jun jul aug sep 
oct nov
dec"),t.month));

and change it to

g.MMM=g.MMMM=_.cache(_.process(g.ctoken(Date.CultureInfo.abbreviatedMonthNames.j
oin('
')),t.month));

I checked the german file, this part is in line 99
NOTE: there is a space in the join function (join(' '))

Original comment by [email protected] on 30 Nov 2009 at 11:03

from datejs.

geoffreymcgill avatar geoffreymcgill commented on July 16, 2024

From @GoogleCodeExporter on April 18, 2015 5:51

You are right, I do not know how to recompile the files. (I even did not know 
that 
this is possible...) So I tried the same as in the test directory, where the 
inclusion of the individual language specific build file is replaced by the 
following sequence:
    <script type='text/javascript' src='../src/globalization/de-DE.js'></script>
    <script type='text/javascript' src='../src/core-debug.js'></script>
    <script type='text/javascript' src='../src/sugarpak-debug.js'></script>
    <script type='text/javascript' src='../src/parser-debug.js'></script>
    <script type='text/javascript' src='../src/time-debug.js'></script>

I also tried to edit the build file and include this one, but the result was 
even 
worse, as no month name whatsoever is parsed any more...

Very disappointing...  :-((

Original comment by [email protected] on 30 Nov 2009 at 3:34

from datejs.

geoffreymcgill avatar geoffreymcgill commented on July 16, 2024

From @GoogleCodeExporter on April 18, 2015 5:51

This issue is present in Spanish language also, at least in es-MX. I think it's 
priority should be set to high since this pretty much makes the library 
unusable for the affected languages.

Original comment by [email protected] on 2 Feb 2012 at 10:38

from datejs.

geoffreymcgill avatar geoffreymcgill commented on July 16, 2024

From @GoogleCodeExporter on April 18, 2015 5:51

fixed in my fork - https://github.com/abritinthebay/datejs/

Original comment by [email protected] on 4 Oct 2013 at 9:26

from datejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.