Hello, Having a boolean *.weekend?* on the Date class would be a good feature. It will basically do this: saturday? || sunday? Makes the code cleaner and easier to read. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.
This introduces a localization issue -- not everyone has a Saturday/Sunday weekend! Particularly Islamic countries: http://en.wikipedia.org/wiki/Workweek_and_weekend#Islamic_countries but also Israel, Nepal, India, and others. On Thu, Jun 27, 2013 at 12:16 PM, Artem Kalinchuk <artem9@gmail.com> wrote:> Hello, > > Having a boolean *.weekend?* on the Date class would be a good feature. > It will basically do this: > > saturday? || sunday? > > Makes the code cleaner and easier to read. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-core+unsubscribe@googlegroups.com. > To post to this group, send email to rubyonrails-core@googlegroups.com. > Visit this group at http://groups.google.com/group/rubyonrails-core. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.
On 28 June 2013 15:04, T.J. Schuck <tj@getharvest.com> wrote:> This introduces a localization issue -- not everyone has a Saturday/Sunday > weekend! Particularly Islamic countries: > http://en.wikipedia.org/wiki/Workweek_and_weekend#Islamic_countries but > also Israel, Nepal, India, and others. > > >Seeing as "beginning_of_week" allows for configuration of the week start day, it doesn''t seem like a huge leap to have configuration for the start and end days of a weekend, with default values identifying Saturday and Sunday. But frankly I''d think this was more of a personal mix-in than a core feature. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.