I’ve tried the simple_date_select plugin and it works as advertised
(Thank you so much!), that is it converts the unwieldy default date
selection boxes into a single text field with the default date format
like yyyy-mm-dd. And, I played with the extension to that plugin
proposed by Jeremy E. that uses strftime(’%m/%d/%Y’) to get it
reformatted like mm/dd/yyyy (Thank you, too, Jeremy).
My problem is that I can’t quite get strftime to format the dates
exactly as I’d like to see them, which is like 6/3/2006 (no zero or
space before the 6 and no zero or space before the 3). Being new to
Ruby, I’m weak on Ruby syntax. Jeremy’s suggested code is:
def to_date_select_tag(options = {})
to_input_field_tag(‘text’, {‘size’=>‘10’,
‘value’=>value.strftime(’%m/%d/%Y’)}.merge(options))
end
I tried to substitute a block {} for the expression
value.strftime(’%m/%d/%Y’) and failed miserably. Can anyone help me out
with some expression to convert a date string like 06/03/2006 to one
like 6/3/2006 that I can plug into the above method?
Thanks, this forum has been SOOOO helpful!
Shauna