Use date comparison functions (DATEDIFF, CURRENT_DATE) in your
database query.
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
On Apr 2, 11:39 am, Remco Swoany
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hi,
>
> I have a table sales with the columns, title, short_description,
> long_description, start_date, end_date. The columns start_date end
> end_date has both a date value.
>
> My sales record are show on a index-page, with the start_date and
> end_date published.
>
> I want on the index-page a "timer" based on end_date. By example
today
> it is 2 april and a sales availability end_date is 4 april, i want to
> show to the consumer "You only have 2 days left" or a
image(2.gif) with
> text in the same context..
>
> I am newbie...someone suggestions/links?
>
> Grtz..remco
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---