-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(meetings): Show upcoming events 📆 #1968
Conversation
Ivansss
commented
Feb 4, 2025
Signed-off-by: Ivan Sein <[email protected]>
…ng events buttton Signed-off-by: Ivan Sein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about the eventTime
method. This seems problematic, translation-wise. shouldn't we better use DateFormatter with the desired format and enable relative formatting and not handle that ourselves?
…bclass Signed-off-by: Ivan Sein <[email protected]>
Couldn't find a way to display event |
For today and tomorrow I would go with let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .long
dateFormatter.timeStyle = .short
dateFormatter.doesRelativeDateFormatting = true
let now = Date()
let tomorrow = Calendar.current.date(byAdding: .day, value: 1, to: now)!
print(dateFormatter.string(from: now))
print(dateFormatter.string(from: tomorrow)) which prints for my locale:
Personally I would also be fine to just use it for all other cases as well, it would show:
for next week.
Alternatively (if we can live without the "at"): let localeArray = ["en_US", "de_DE"]
for localeID in localeArray {
print(now.formatted(.dateTime
.weekday(.wide)
.hour(.conversationalTwoDigits(amPM: .wide))
.minute(.defaultDigits)
.locale(Locale(identifier: localeID))
))
} could be used for the < 1 week and displays:
|
Signed-off-by: Ivan Sein <[email protected]>
Signed-off-by: Ivan Sein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌