diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/registration.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/registration.rb b/lib/registration.rb index 6afe8b6..bebe326 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -1,5 +1,6 @@ require_relative 'band' require_relative 'pdf_form' +require 'date' require 'mail' def send_registration_emails_for(band, pdf_url) @@ -30,3 +31,9 @@ end def create_pdf_file_name(band) filename = "#{Date.today.iso8601}-#{sanitize(band.name)}-#{sanitize(band.city)}.pdf" end + +def accept_registrations(settings) + start_date = Date.parse(settings.accept_registrations[:start]) + end_date = Date.parse(settings.accept_registrations[:stop]) + start_date <= Date.today && end_date > Date.today +end |