baskar007 / datejs

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

Incorrect ISO 8601 with Timezone offset Date Parsing. #59

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Date.parse('1997-07-16T19:20:30+00:00').toISOString() !=
"1997-07-16T10:20:30Z"
2. '+00:00' is not recognized as UTC but as timezone of current machine.

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

- svn version

Original issue reported on code.google.com by happy...@gmail.com on 23 Jan 2009 at 4:04

GoogleCodeExporter commented 8 years ago
Also,

Using Safari 4 and svn trunk of datejs: Date.parse('1997-07-16T19:20:30Z') != 
Date.parse(Date.parse('1997-07-16T19:20:30Z').toISOString())

Original comment by smonkew...@gmail.com on 6 Aug 2009 at 1:47

GoogleCodeExporter commented 8 years ago
Hi,

I have had a potentially similar problem.
The Date.parse function will not parse the timezone data.

For instance, Date.parse("2010-03-11T09:00:00+01:00") returns null.

I have searched around but found nothing, until I reached the homepage of 
datejs.com.

There, the demo input field accepted the previous date and parsed it correctly.
It was a little surprising so I tried and downloaded the date.js file used 
there and
it worked for me too :)

The date.js built used on the www.datejs.com website has the version:

/**
 * @version: 1.0 Alpha-1
 * @author: Coolite Inc. http://www.coolite.com/
 * @date: 2008-05-13
 * @copyright: Copyright (c) 2006-2008, Coolite Inc. (http://www.coolite.com/). All
rights reserved.
 * @license: Licensed under The MIT License. See license.txt and
http://www.datejs.com/license/. 
 * @website: http://www.datejs.com/
 */

This version parses timezones.

The latest built:
/**
 * Version: 1.0 Alpha-1 
 * Build Date: 13-Nov-2007
 * Copyright (c) 2006-2007, Coolite Inc. (http://www.coolite.com/). All rights reserved.
 * License: Licensed under The MIT License. See license.txt and
http://www.datejs.com/license/. 
 * Website: http://www.datejs.com/ or http://www.coolite.com/datejs/
 */

Does not parse the timezones (or I do something wrong)

Cheers!

Original comment by nicolas....@gmail.com on 10 Mar 2010 at 4:25

Attachments:

GoogleCodeExporter commented 8 years ago
Wanted to second what nicolas said in comment #2.

I ran into the exact issue, tried the same thing he did and had the same result.

Original comment by Lemagicb...@gmail.com on 18 Jun 2010 at 11:41

GoogleCodeExporter commented 8 years ago
Over a year later and this fixed the issue for me too

Original comment by bes...@gmail.com on 22 Jun 2011 at 8:55

GoogleCodeExporter commented 8 years ago
I've got the same problem, the file in the second comment fix the parse method, 
but not the parseExact one. BTW, is this project dead or it has moved 
elsewhere???

Original comment by nbudu...@gmail.com on 7 Nov 2011 at 6:18

GoogleCodeExporter commented 8 years ago
Note that the first version is still broken, just in a horribly subtle way.

+00:00 instead of being interpreted as UTC, will be interpreted as your local 
timezone. The rest looks like it's ok.

Original comment by cpbotha on 9 May 2012 at 6:22

GoogleCodeExporter commented 8 years ago
I also came across the same problem. Why is the site using a version from 2008 
and the one available for download is from 2007?

Original comment by elfishaw...@gmail.com on 2 Oct 2012 at 11:20

GoogleCodeExporter commented 8 years ago
fixed in the current build at my fork:
https://github.com/abritinthebay/datejs/

Original comment by darkcr...@gmail.com on 14 Sep 2013 at 8:24