Hey
This mostly behaves, but the first time I add a birthdate to a user,
month and date are reversed! So I set the birthdate to January 11,
then after saving and returning, it's November 1! Both forms post with
month in "2i" and date in "3i" but somewhere it's being interpreted
backwards.
I got the latest AS about two weeks ago; using with rails 2.1.1.
Brad
On Sep 21, 11:01 pm, bmidgley <[EMAIL PROTECTED]> wrote:
> Hey
>
> This was fairly simple so I'll just reply to myself. I gave up on a
> custom sort. The regular sort is good enough and better-behaved than
> something that works from the current date.
>
> This all falls in the admin helper.
>
> $ cat app/helpers/admin_helper.rb
> module AdminHelper
> def birthday_form_column(record, input_name)
> date_select :record, :birthday, :discard_year =>
> true, :include_blank => true
> end
>
> def birthday_column(record)
> record.birthday ? "#{record.birthday.month}/
> #{record.birthday.day}" : ""
> end
> end
>
> Brad
>
> On Sep 20, 10:18 pm, "Brad Midgley" <[EMAIL PROTECTED]> wrote:
>
> > Hey
>
> > What is the best way to get a "birthday" date picker?
>
> > - It would not show year or time in picker
> > - if date value is null, don't default to saving today's date in the
> > field--leave it null
> > - sorting by this field would ideally show you records in the order
> > that birthdays are coming up
>
> > --
> > Brad
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---