mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #710 from differentreality/fix_api
undo deletion of function, so that api works (/api/v1/conferences/)
This commit is contained in:
commit
37697517df
1 changed files with 18 additions and 0 deletions
|
|
@ -113,6 +113,24 @@ class Conference < ActiveRecord::Base
|
|||
before_create :create_email_settings
|
||||
before_create :add_color
|
||||
|
||||
def date_range_string
|
||||
startstr = "Unknown - "
|
||||
endstr = "Unknown"
|
||||
if start_date.month == end_date.month && start_date.year == end_date.year
|
||||
startstr = start_date.strftime("%B %d - ")
|
||||
endstr = end_date.strftime("%d, %Y")
|
||||
elsif start_date.month != end_date.month && start_date.year == end_date.year
|
||||
startstr = start_date.strftime("%B %d - ")
|
||||
endstr = end_date.strftime("%B %d, %Y")
|
||||
else
|
||||
startstr = start_date.strftime("%B %d, %Y - ")
|
||||
endstr = end_date.strftime("%B %d, %Y")
|
||||
end
|
||||
|
||||
result = startstr + endstr
|
||||
result
|
||||
end
|
||||
|
||||
##
|
||||
# Checks if the user is registered to the conference
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue