'ArgumentError: bad value for range' for range of Times

Discussion in 'Ruby' started by David Bird, Jun 23, 2008.

  1. David Bird

    David Bird Guest

    Hi,

    When using the calendar_date_select plugin, Rails kept throwing an
    ArgumentError: 'bad value for range', but only on Windows (fine on
    OSX). Playing around in the console I get...

    >> 38.years.ago..10.years.ago

    => Tue Jun 23 19:12:11 +1000 1970..Tue Jun 23 19:12:11 +1000 1998

    >> 39.years.ago..10.years.ago

    ArgumentError: bad value for range

    Any ideas?

    Thanks
     
    David Bird, Jun 23, 2008
    #1
    1. Advertisements

  2. David Bird

    Tiago Macedo Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Just guessing:

    39 years ago is before 1970, I believe there is some sort of problem in
    Windows with dates prior to 1970.

    David Bird wrote:
    | Hi,
    |
    | When using the calendar_date_select plugin, Rails kept throwing an
    | ArgumentError: 'bad value for range', but only on Windows (fine on
    | OSX). Playing around in the console I get...
    |
    |>> 38.years.ago..10.years.ago
    | => Tue Jun 23 19:12:11 +1000 1970..Tue Jun 23 19:12:11 +1000 1998
    |
    |>> 39.years.ago..10.years.ago
    | ArgumentError: bad value for range
    |
    | Any ideas?
    |
    | Thanks
    |
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iEYEARECAAYFAkhfkmAACgkQxFuRTtCTMvL5zACeLzqreWeBlZUyg2Q5zYo6d6aA
    fBkAn2OrUIJhVNvoYkXlf7Cg1/F90Nz6
    =htFN
    -----END PGP SIGNATURE-----
     
    Tiago Macedo, Jun 23, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWF2cmlja18xMDE=?=

    SetAuthCookie works some times and fails some times?

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 23, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    810
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 23, 2006
  2. =?Utf-8?B?bWF2cmlja18xMDE=?=

    Forms Authentication Fails some times and not some times???

    =?Utf-8?B?bWF2cmlja18xMDE=?=, Mar 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    674
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    Mar 28, 2006
  3. djskrill
    Replies:
    9
    Views:
    890
    djskrill
    Oct 1, 2003
  4. Peng Yu
    Replies:
    17
    Views:
    926
    Peng Yu
    Sep 14, 2008
  5. Jack Steven
    Replies:
    2
    Views:
    682
    Chris Rebert
    Mar 9, 2009
  6. rantingrick
    Replies:
    44
    Views:
    1,913
    Peter Pearson
    Jul 13, 2010
  7. Bil Kleb
    Replies:
    1
    Views:
    537
    Bil Kleb
    Feb 14, 2004
  8. Simon Strandgaard

    Math.sqrt(-1) doesn't raise ArgumentError

    Simon Strandgaard, Feb 16, 2004, in forum: Ruby
    Replies:
    4
    Views:
    244
    Josef 'Jupp' SCHUGT
    Feb 16, 2004
Loading...