'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. Advertising

  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. Advertising

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. rantingrick
    Replies:
    44
    Views:
    1,250
    Peter Pearson
    Jul 13, 2010
  2. Bil Kleb
    Replies:
    1
    Views:
    306
    Bil Kleb
    Feb 14, 2004
  3. Simon Strandgaard

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

    Simon Strandgaard, Feb 16, 2004, in forum: Ruby
    Replies:
    4
    Views:
    134
    Josef 'Jupp' SCHUGT
    Feb 16, 2004
  4. jay
    Replies:
    1
    Views:
    130
    Austin Ziegler
    Feb 22, 2007
  5. Dan Stevens (IAmAI)
    Replies:
    4
    Views:
    137
    Dan Stevens (IAmAI)
    Apr 2, 2007
Loading...

Share This Page