Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D333965C1 for ; Wed, 6 Jul 2011 21:50:39 +0000 (UTC) Received: (qmail 14155 invoked by uid 500); 6 Jul 2011 21:50:38 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 14037 invoked by uid 500); 6 Jul 2011 21:50:37 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 14029 invoked by uid 99); 6 Jul 2011 21:50:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 21:50:37 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of maxosmail@gmail.com designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 21:50:31 +0000 Received: by vws16 with SMTP id 16so480381vws.11 for ; Wed, 06 Jul 2011 14:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=yWjoXElNFn1ZBV6+hmq1dtP8q10Ro/wAcRmajTLGY1Q=; b=T1SBftVZZqIFQbIsq5OY824h2qIm/LSZGYwf2VTtttPU1fX+5LgNM4lMOKs4dGnJ1J F3kgIURr9ek8cZV5T+RVcWG0t8pSGOsRVQCWSGTbffVqd2MDi7fzaWmVU3pjm3SOZnzy Sltv5VS811MMEH4qugQ+b86sFdkJLDsybXiCQ= Received: by 10.52.20.180 with SMTP id o20mr60494vde.311.1309989011067; Wed, 06 Jul 2011 14:50:11 -0700 (PDT) MIME-Version: 1.0 Sender: maxosmail@gmail.com Received: by 10.52.114.170 with HTTP; Wed, 6 Jul 2011 14:49:51 -0700 (PDT) In-Reply-To: References: From: Max Ogden Date: Wed, 6 Jul 2011 14:49:51 -0700 X-Google-Sender-Auth: Cu2_j5SOOuuO3napg1eox7HUDFU Message-ID: Subject: Re: Bug with Date.parse To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=20cf307ca318aa140504a76d9569 --20cf307ca318aa140504a76d9569 Content-Type: text/plain; charset=UTF-8 I would recommend using ISO8601/RFC3339 if you want to play nice with javascript... back in the jchris days couchrest used to use it by default. require 'time' Time.now.iso8601 On Wed, Jul 6, 2011 at 2:24 PM, kowsik wrote: > Tracking down an issue with our production couch's and wanted to run > this by you guys. We have views that look like this: > > emit(Date.parse(doc.updated_at), null); > > where the updated_at is generated using CouchRest (Time.now.to_json). > I was seeing nulls show up as the keys and digging a little deeper > tracked it down to this: > > Date.parse("2011-07-05 14:03:24 -0700") returns NaN with > Firefox/Spidermonkey and Safari while Chrome/v8 is fine. > > [ digging deeper ] > > Okay, found out. Turns out we recently upgraded CouchRest to 1.1 which > no longer monkey patches Time.now resulting in hyphens in the > yyyy-mm-dd as opposed to slashes in the older version. FF and Safari > don't likey the hyphens and return Nan which messes up the views. > > Just a heads up, > > K. > --- > http://blitz.io > http://twitter.com/pcapr > --20cf307ca318aa140504a76d9569--