Skip to content

Commit 8c57164

Browse files
authored
Merge pull request #677 from multiplex55/codex/update-calendar-popover-to-sunday-start
Switch calendars to Sunday-first layout
2 parents 435d102 + fd46254 commit 8c57164

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/dashboard/widgets/calendar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,21 +437,21 @@ fn month_grid(
437437
compact: bool,
438438
mut on_select: impl FnMut(NaiveDate),
439439
) {
440-
let first_weekday = month.weekday().num_days_from_monday() as i32;
440+
let first_weekday = month.weekday().num_days_from_sunday() as i32;
441441
let days = days_in_month(month);
442442
let spacing = if compact { [2.0, 2.0] } else { [4.0, 4.0] };
443443
egui::Grid::new("calendar_widget_month_grid")
444444
.num_columns(7)
445445
.spacing(spacing)
446446
.show(ui, |ui| {
447447
for weekday in [
448+
chrono::Weekday::Sun,
448449
chrono::Weekday::Mon,
449450
chrono::Weekday::Tue,
450451
chrono::Weekday::Wed,
451452
chrono::Weekday::Thu,
452453
chrono::Weekday::Fri,
453454
chrono::Weekday::Sat,
454-
chrono::Weekday::Sun,
455455
] {
456456
ui.label(weekday.to_string());
457457
}

src/gui/calendar_popover.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,20 @@ fn month_grid(
182182
markers: &HashSet<NaiveDate>,
183183
today: NaiveDate,
184184
) {
185-
let first_weekday = month.weekday().num_days_from_monday() as i32;
185+
let first_weekday = month.weekday().num_days_from_sunday() as i32;
186186
let days = days_in_month(month);
187187
egui::Grid::new("calendar_month_grid")
188188
.num_columns(7)
189189
.spacing([4.0, 4.0])
190190
.show(ui, |ui| {
191191
for weekday in [
192+
Weekday::Sun,
192193
Weekday::Mon,
193194
Weekday::Tue,
194195
Weekday::Wed,
195196
Weekday::Thu,
196197
Weekday::Fri,
197198
Weekday::Sat,
198-
Weekday::Sun,
199199
] {
200200
ui.label(weekday.to_string());
201201
}

0 commit comments

Comments
 (0)