Don''t know if this answers your question. I think your question is a
little vague ...
So I just answer the first thing I thought of when I saw your question:
(base rails 3 - don''t know which version you use)...
class Report < ActiveModel::Base/ActiveRecord::Base
...
validates :report_date, :no_weekend => true
...
end
and as validator
class NoWeekendValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
record.errors[attribute] << (options[:message] ||
"mustn''t be a
weekend") if value.saturday? || value.sunday?
end
end
I don''t know if you use a datepicker or which datepicker you could use.
But it should be possible to configure it so you can''t pick weekends.
On 01/02/11 18:36, Ithelp Eighty-five wrote:> Hello,
>
> I have an app where I allow users to select dates and run reports base
> off those dates. But the problem I cant figure out is how to exclude the
> weekends(Sat, Sun) The report should just give data for Mon-Fri.
>
> Thanks in advance for any help!
>
--
best regards
Bente Pieck
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.