you can now unset the year of your birthday"
This commit is contained in:
parent
96b907122b
commit
b3c63a3cc0
4 changed files with 13 additions and 5 deletions
|
|
@ -19,4 +19,12 @@ module PeopleHelper
|
||||||
I18n.t "people.helper.people_on_pod_are_aware_of"
|
I18n.t "people.helper.people_on_pod_are_aware_of"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def birthday_format(bday)
|
||||||
|
if bday.year == 1000
|
||||||
|
bday.strftime("%B %d")
|
||||||
|
else
|
||||||
|
bday.strftime("%B %d %Y")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,11 @@ class Profile
|
||||||
end
|
end
|
||||||
|
|
||||||
def date= params
|
def date= params
|
||||||
if ['year', 'month', 'day'].all? { |key| params[key].present? }
|
params['year'] = '1000' if params['year'].blank?
|
||||||
|
if ['month', 'day'].all? { |key| params[key].present? }
|
||||||
date = Date.new(params['year'].to_i, params['month'].to_i, params['day'].to_i)
|
date = Date.new(params['year'].to_i, params['month'].to_i, params['day'].to_i)
|
||||||
self.birthday = date
|
self.birthday = date
|
||||||
elsif ['year', 'month', 'day'].all? { |key| params[key] == '' }
|
elsif ['month', 'day'].all? { |key| params[key].blank? }
|
||||||
self.birthday = nil
|
self.birthday = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -54,5 +54,4 @@
|
||||||
- unless person.profile.birthday.blank?
|
- unless person.profile.birthday.blank?
|
||||||
%h3
|
%h3
|
||||||
=t('.born')
|
=t('.born')
|
||||||
= t('ago', :time => time_ago_in_words(person.profile.birthday)) if @person.profile.birthday
|
= birthday_format(person.profile.birthday)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,7 @@ en:
|
||||||
edit_my_profile: "Edit my profile"
|
edit_my_profile: "Edit my profile"
|
||||||
bio: "bio"
|
bio: "bio"
|
||||||
gender: "gender"
|
gender: "gender"
|
||||||
born: "born"
|
born: "birthday"
|
||||||
in_aspects: "in aspects"
|
in_aspects: "in aspects"
|
||||||
cannot_remove: "Cannot remove %{name} from last aspect. (If you want to disconnect from this person you must remove contact.)"
|
cannot_remove: "Cannot remove %{name} from last aspect. (If you want to disconnect from this person you must remove contact.)"
|
||||||
remove_from: "Remove %{name} from %{aspect}?"
|
remove_from: "Remove %{name} from %{aspect}?"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue