Forum: Ruby on Rails Show text or image, based on data value

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
28be3be213eeed3f66e0a20f1e20c7ac?d=identicon&s=25 Remco Swoany (zwaan123)
on 2009-04-02 17:39
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
775dc78d64c87ae51db522529c3784e9?d=identicon&s=25 Phillip (Guest)
on 2009-04-03 17:23
(Received via mailing list)
Use date comparison functions (DATEDIFF, CURRENT_DATE) in your
database query.

http://dev.mysql.com/doc/refman/5.0/en/date-and-ti...


On Apr 2, 11:39 am, Remco Swoany <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.