aboutsummaryrefslogtreecommitdiff
path: root/HoloBar/CharacterFetcher.swift
diff options
context:
space:
mode:
Diffstat (limited to 'HoloBar/CharacterFetcher.swift')
-rw-r--r--HoloBar/CharacterFetcher.swift9
1 files changed, 9 insertions, 0 deletions
diff --git a/HoloBar/CharacterFetcher.swift b/HoloBar/CharacterFetcher.swift
index 7ba6854..c9d5a9b 100644
--- a/HoloBar/CharacterFetcher.swift
+++ b/HoloBar/CharacterFetcher.swift
@@ -122,4 +122,13 @@ class CharacterFetcher: ObservableObject {
self.characters = updatedCharacters
}
}
+
+ func refreshCharactersForToday() {
+ let today = Calendar.current.dateComponents([.month, .day], from: Date())
+
+ if let month = today.month, let day = today.day {
+ characters.removeAll()
+ fetchCharacters(for: month, day: day)
+ }
+ }
}