On 16 March 2016 at 08:05, Naveed Alam <lists@ruby-forum.com> wrote:
>>
>> Why are you not using Roster.Duty.where(...)?
>>
>> Colin
>
> Thanks dear it worked, I just changed
>
> @theday =Time.now.strftime('%A').downcase
>
> to this
> @theday =Time.now.strftime('%w')
Does Time.now.wday not work?
One thing to watch out for is time zones. If the user and the rails
server are both set to the same timezone then you should be ok, but if
they are using different timezones then time.now (which runs on the
server) will not show the users time, so the time (for the user) at
which the current day changes from, for example, sunday to monday,
will not be midnight.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu1CCS6npjV7MyLdVaFKx%3Duwg1ysQRNerFcq3_TFohyJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment