Details

    • Skill Level:
      Dont Know

      Description

      The current js view server doesn't parse Date format ISO8601. This is a widely used date format and date parse class should be made to parse ISO8601.

        Activity

        Hide
        Randall Leeds added a comment -

        I'm not sure what you mean. I just tried putting a ISO8601 date string in a document on the date property. Running a view that does emit(null, Date(doc.date).toTimeString()) seems to work no problem, indicating it's parsing without issue.

        Could you please clarify your issue or expectations?

        Show
        Randall Leeds added a comment - I'm not sure what you mean. I just tried putting a ISO8601 date string in a document on the date property. Running a view that does emit(null, Date(doc.date).toTimeString()) seems to work no problem, indicating it's parsing without issue. Could you please clarify your issue or expectations?
        Hide
        Knodi added a comment -

        I tried

        doc.date is 2011-08-20T05:53:44Z and emit(null, Date(doc.date).toTimeString()) is causing this error Log :: function raised exception (new TypeError("Date(doc.date).toTimeString is not a function", "", 3))

        Show
        Knodi added a comment - I tried doc.date is 2011-08-20T05:53:44Z and emit(null, Date(doc.date).toTimeString()) is causing this error Log :: function raised exception (new TypeError("Date(doc.date).toTimeString is not a function", "", 3))
        Hide
        Knodi added a comment -

        Also doing Date(doc.date).toTimeString() on invalid date only defaults to current time and doesn't parse the doc.date.

        Show
        Knodi added a comment - Also doing Date(doc.date).toTimeString() on invalid date only defaults to current time and doesn't parse the doc.date.
        Hide
        Randall Leeds added a comment -

        I apologize. It's necessary to use the 'new' keyword with Date in order to construct a date from a string.

        Show
        Randall Leeds added a comment - I apologize. It's necessary to use the 'new' keyword with Date in order to construct a date from a string.
        Hide
        Knodi added a comment - - edited

        Also tried that

        var d = new Date("2011-09-14T03:42:09Z")
        emit(d.toTimeString(), null);

        Results in "Invalid Date" string key.

        Show
        Knodi added a comment - - edited Also tried that var d = new Date("2011-09-14T03:42:09Z") emit(d.toTimeString(), null); Results in "Invalid Date" string key.
        Hide
        Paul Joseph Davis added a comment -

        Really it should be can't fix. If the Date class can't parse this date format its a SpiderMonkey version issue and that should be upgraded to whatever. Even if we wanted to write our own date parsing function we couldn't automatically enable it on the Date object.

        Bottom line, if its a real error, upgrade SpiderMonkey.

        Show
        Paul Joseph Davis added a comment - Really it should be can't fix. If the Date class can't parse this date format its a SpiderMonkey version issue and that should be upgraded to whatever. Even if we wanted to write our own date parsing function we couldn't automatically enable it on the Date object. Bottom line, if its a real error, upgrade SpiderMonkey.
        Hide
        Randall Leeds added a comment -

        Paul beat me to it:

        I believe the behavior you see has to do with SpiderMonkey and not CouchDB. I've tried with SpiderMonkey 1.8.5 and 1.8.0 (from xulrunner) and do not observe any problems. Perhaps you're using an older version. If you did not build CouchDB yourself or if you would like help checking your SpiderMonkey version and building a new CouchDB (you can stay on the 1.0.x series to be safe) against it, please follow up on the users mailing list or in IRC.

        If you think my assessment is wrong, I apologize. Please just re-open the ticket.

        Show
        Randall Leeds added a comment - Paul beat me to it: I believe the behavior you see has to do with SpiderMonkey and not CouchDB. I've tried with SpiderMonkey 1.8.5 and 1.8.0 (from xulrunner) and do not observe any problems. Perhaps you're using an older version. If you did not build CouchDB yourself or if you would like help checking your SpiderMonkey version and building a new CouchDB (you can stay on the 1.0.x series to be safe) against it, please follow up on the users mailing list or in IRC. If you think my assessment is wrong, I apologize. Please just re-open the ticket.
        Hide
        Knodi added a comment -

        I'm using the couchdbx package for mac. I'll upgrade to couchdb single server package for mac.

        Show
        Knodi added a comment - I'm using the couchdbx package for mac. I'll upgrade to couchdb single server package for mac.

          People

          • Assignee:
            Unassigned
            Reporter:
            Knodi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development