CopyPastor

Detecting plagiarism made easy.

Score: 0.8170895166876251; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-01-29
by adarsh

Original Post

Original - Posted on 2013-11-10
by CDub



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Why not just store the datestamp then use the built in functionality for Date to get the day of the week?
2.0.0p247 :139 > Date.today => Sun, 10 Nov 2013 2.0.0p247 :140 > Date.today.strftime("%A") => "Sunday"

Why not just store the datestamp then use the built in functionality for `Date` to get the day of the week?
2.0.0p247 :139 > Date.today => Sun, 10 Nov 2013 2.0.0p247 :140 > Date.today.strftime("%A") => "Sunday"
`strftime` sounds like it can do everything for you. [Here][1] are the specific docs for it.
Specifically for what you're talking about, it sounds like you'd need an `Event` table that `has_many :schedules`, where a `Schedule` would have a `start_date` timestamp...
[1]: http://ruby-doc.org/stdlib-2.0.0/libdoc/date/rdoc/Date.html#method-i-strftime

        
Present in both answers; Present only in the new answer; Present only in the old answer;