Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

datejs parse errors on iPhone since 1.1.0

I have been using the datejs library in my app since 0.8. As of 1.1.0 I have been getting a lot of failures in the Date.parse() function. Parsing times with AM or PM (eg. '8:11 AM') specified will always fail and return null. '8:11' without the AM works fine.

I have uploaded a sample app that recreates the issue to pastie. You can checkout the date.js from svn, but Titanium has issues parsing it. I have uploaded a version that gets rid of the compiler warnings to pastie

Again, this was working fine in Titanium 0.8 and 1.0, but fails in 1.10 and higher.

eta: It seems to work fine on actual hardware. It only fails on the iPhone simulator (v3.1+).

— asked April 9th 2010 by Charles Jones
  • date
  • datejs
  • iphone
  • mobile
  • parse
1 Comment
  • Hi Charles. Thanks for the resource on Pastie. How did you actually implement this? I am trying to use the very useful add function. Could you give me a tiny sample of code? Do you require the file and then call the methods?


    — commented September 8th 2011 by Leonardo Amigoni

4 Answers

  • i am also getting issues with this every time i try to run titanium with debug to use breakpoints it just hits the date.js plugin and titanium gives a lot of errors i have tried the latest

    — answered August 28th 2012 by Samuel East
  • Dates appear to be broken in Titanium… compare to node.js:

    var datestr = "2011-02-25T23:48:16Z";

    Where as Titanium:

    var datestr = "2011-02-25T23:48:16Z";
    [INFO] nan

    Not sure of a good work around…

    — answered May 9th 2011 by todd fisher
  • Yes, I'm also having this problem, I don't know if Appcelerator is working on this, I hope so…

    — answered July 27th 2011 by Cedrik Boudreau-Batista
  • Any news on this one? Is it working now?

    — answered September 8th 2011 by Leonardo Amigoni
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.