Marston Alfred
2006-Apr-20 09:10 UTC
[Rails] Small Date Formatting Question regarding datetime_select()
Is there a way to make datetime_select() dropdowns work on a 12hr clock? I need to make a input field that works exactly like the reminders datetime selecton dropdowns in Backpack to populate a datetime field in my DB. i.e in the format: month, day, year ? hour (1-12) minute am/pm. Should I change my database to have a separate column for date and one for time and use date_select()? Can I do that with datetime_select or will I have to create a special helper method and what would that code look like? Thanks for any info in advance.
Mark Paxton
2006-Apr-20 12:37 UTC
[Rails] Re: Small Date Formatting Question regarding datetime_select
Marston A. wrote:> Is there a way to make datetime_select() dropdowns work on a 12hr > clock?Hello, Check out the following plugin: wiki.rubyonrails.org/rails/pages/12-Hour+Time+Plugin Regards, Mark -- Posted via ruby-forum.com.
Marston Alfred
2006-Apr-20 13:16 UTC
[Rails] Re: Small Date Formatting Question regarding datetime_select
Mark, Excellent, thanks I will definitely check this out. Would you happen to know how to change the default date format in datetime_select() (also identical to how its shown in the reminders section of backpack). I.e have dropdowns like: [April] [20] [2006] instead of the default [2006] [April] [20] ? On Apr 20, 2006, at 2:37 PM, Mark Paxton wrote:> Marston A. wrote: >> Is there a way to make datetime_select() dropdowns work on a 12hr >> clock? > > Hello, > > Check out the following plugin: > > wiki.rubyonrails.org/rails/pages/12-Hour+Time+Plugin > > Regards, > Mark > > -- > Posted via ruby-forum.com. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails
Mark Paxton
2006-Apr-20 23:01 UTC
[Rails] Re: Re: Small Date Formatting Question regarding datetime_se
Marston A. wrote:> Mark, > > Excellent, thanks I will definitely check this out. > > Would you happen to know how to change the default date format in > datetime_select() (also identical to how its shown in the reminders > section of backpack). I.e have dropdowns like: > > [April] [20] [2006] > > instead of the default > > [2006] [April] [20] > > ?Not sure, I think there may be a different plugin that does both: wiki.rubyonrails.org/rails/pages/FlexTimes+Plugin Mark -- Posted via ruby-forum.com.
Tom Mornini
2006-Apr-21 00:09 UTC
[Rails] Re: Re: Small Date Formatting Question regarding datetime_se
Here''s a snippet from one of my projects: <%= date_select ''user'', ''born_on'', :start_year => Time.now.years_ago(100).year, :end_year => Time.now.years_ago(18).year, :order => [:month,:day,:year] %> -- -- Tom Mornini On Apr 20, 2006, at 4:01 PM, Mark Paxton wrote:> Marston A. wrote: >> Mark, >> >> Excellent, thanks I will definitely check this out. >> >> Would you happen to know how to change the default date format in >> datetime_select() (also identical to how its shown in the reminders >> section of backpack). I.e have dropdowns like: >> >> [April] [20] [2006] >> >> instead of the default >> >> [2006] [April] [20] >> >> ? > > Not sure, I think there may be a different plugin that does both: > wiki.rubyonrails.org/rails/pages/FlexTimes+Plugin > > Mark > > -- > Posted via ruby-forum.com. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails