diff --git a/Motivation/AgeView.swift b/Motivation/AgeView.swift index 414329c..00a92d2 100644 --- a/Motivation/AgeView.swift +++ b/Motivation/AgeView.swift @@ -115,7 +115,7 @@ class AgeView: ScreenSaverView { animationTimeInterval = 1 / 30 // Recall preferences - birthday = Preferences().birthday + updateBirthday() // Setup the label addSubview(textLabel) @@ -165,9 +165,17 @@ class AgeView: ScreenSaverView { /// Birthday changed @objc private func birthdayDidChange(_ notification: Notification?) { - birthday = Preferences().birthday + updateBirthday() } + private func updateBirthday() { + if let dateComponents = Preferences().birthdayComponents { + birthday = Calendar.current.date(from: dateComponents) + } else { + birthday = Date() + } + } + /// Update the font for the current size private func updateFont() { if birthday != nil { diff --git a/Motivation/Configuration.xib b/Motivation/Configuration.xib index 676e59a..55aca8f 100644 --- a/Motivation/Configuration.xib +++ b/Motivation/Configuration.xib @@ -9,6 +9,7 @@ + @@ -105,8 +106,8 @@ DQ