mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
If the conference has only one day, not put the day twice in splashpage info. fix #780
This commit is contained in:
parent
ed083be58b
commit
a88bb4ea97
1 changed files with 9 additions and 2 deletions
|
|
@ -71,6 +71,8 @@ class ApplicationController < ActionController::Base
|
||||||
##
|
##
|
||||||
# Returns a string build from the start and end date of the given conference.
|
# Returns a string build from the start and end date of the given conference.
|
||||||
#
|
#
|
||||||
|
# If the conference is only one day long
|
||||||
|
# * %B %d %Y (January 17 2014)
|
||||||
# If the conference starts and ends in the same month and year
|
# If the conference starts and ends in the same month and year
|
||||||
# * %B %d - %d, %Y (January 17 - 21 2014)
|
# * %B %d - %d, %Y (January 17 - 21 2014)
|
||||||
# If the conference ends in another month but in the same year
|
# If the conference ends in another month but in the same year
|
||||||
|
|
@ -82,8 +84,13 @@ class ApplicationController < ActionController::Base
|
||||||
endstr = 'Unknown'
|
endstr = 'Unknown'
|
||||||
# When the conference in the same month
|
# When the conference in the same month
|
||||||
if start_date.month == end_date.month && start_date.year == end_date.year
|
if start_date.month == end_date.month && start_date.year == end_date.year
|
||||||
startstr = start_date.strftime('%B %d - ')
|
if start_date.day == end_date.day
|
||||||
endstr = end_date.strftime('%d, %Y')
|
startstr = start_date.strftime('%B %d')
|
||||||
|
endstr = end_date.strftime(' %Y')
|
||||||
|
else
|
||||||
|
startstr = start_date.strftime('%B %d - ')
|
||||||
|
endstr = end_date.strftime('%d, %Y')
|
||||||
|
end
|
||||||
elsif start_date.month != end_date.month && start_date.year == end_date.year
|
elsif start_date.month != end_date.month && start_date.year == end_date.year
|
||||||
startstr = start_date.strftime('%B %d - ')
|
startstr = start_date.strftime('%B %d - ')
|
||||||
endstr = end_date.strftime('%B %d, %Y')
|
endstr = end_date.strftime('%B %d, %Y')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue