Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

select_datetime: Documentation or Implementation Bug

#1051

select_datetime docu states that there was an option :datetime_seperator, but there is no code in either select_datetime nor the delegated select_date that would handle that seperator. So either documentation or implementation is wrong.

Reported by apeiros · September 15th, 2008 @ 03:01 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. apeiros
    apeiros

    A possible fix for 2.1 (cleaned up the other code too a bit) is attached.

    September 15th, 2008 @ 03:34 PM

  2. Pratik
    Pratik
    • Assigned user set to Pratik
    • State changed from new to hold
    • Tag changed from actionpack, datehelper, helper to actionpack, datehelper, helper

    September 18th, 2008 @ 08:53 PM

  3. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from hold to open
    • Tag changed from actionpack, datehelper, helper to actionpack, bugmash, datehelper, helper

    August 3rd, 2009 @ 03:21 PM

  4. Rizwan Reza
    Rizwan Reza

    verified

    +1 This error is happening in 2-3-stable and master.

    August 8th, 2009 @ 02:43 PM

  5. José Valim
    José Valim
    • State changed from open to stale

    On edge :datetime_separator is available and tested.

    August 8th, 2009 @ 02:49 PM

  6. José Valim
    José Valim
    • State changed from stale to invalid

    August 8th, 2009 @ 02:53 PM

  7. José Valim
    José Valim
    • State changed from invalid to new

    Since Rizwan reported he could verify it, I'm reopening.

    August 8th, 2009 @ 02:56 PM

  8. Rizwan Reza
    Rizwan Reza
    • Assigned user changed from Pratik to José Valim
    • Tag changed from actionpack, bugmash, datehelper, helper to actionpack, bug, bugmash, datehelper, helper

    verified

    +1 This error is still happening on edge. By glancing at date_helper.rb, I can see that there is some mechanism to tackle separators, but it's not working.

    This works:

      select_datetime()
    

    But this does not:

      select_datetime(:date_separator => '/')
    

    Unfortunately, I can't understand the underlying code. The patch is not working as well.

    August 8th, 2009 @ 03:46 PM

  9. Matt Duncan
    Matt Duncan
    • Assigned user changed from José Valim to Pratik
    • Tag changed from actionpack, bug, bugmash, datehelper, helper to actionpack, bugmash, datehelper, helper

    Not Reproducible.

    The following tests in actionpack/test/template/date_helper_test.rb (2-3-stable and master) all use the :datetime_separator option:

    • test_select_datetime_with_separators
    • test_select_datetime_with_all_separators
    • test_datetime_select_with_separators

    August 8th, 2009 @ 03:49 PM

  10. Matt Duncan
    Matt Duncan
    • Assigned user changed from Pratik to José Valim
    • Tag changed from actionpack, bugmash, datehelper, helper to actionpack, bug, bugmash, datehelper, helper

    Fixing Rizwan's user/tag changes that got overwritten with my comment.

    August 8th, 2009 @ 03:52 PM

  11. Rizwan Reza
    Rizwan Reza

    While creating a test case. I encountered this:

     select_datetime(Time.now, {:datetime_separator => "—"})
    

    This is working. The main confusion is that when this works:

      select_datetime()
    

    How can this not?

      select_datetime({:datetime_separator => "—"})
    

    Conclusion: The first argument is necessary for separators to work.

    No bug here. :)

    August 8th, 2009 @ 04:05 PM

  12. José Valim
    José Valim
    • State changed from new to invalid

    August 8th, 2009 @ 04:11 PM

  13. CancelProfileIsBroken
    CancelProfileIsBroken
    • Assigned user cleared.
    • Tag changed from actionpack, bug, bugmash, datehelper, helper to actionpack, bug, datehelper, helper
    • Milestone cleared.

    August 8th, 2009 @ 11:06 PM