Skip to content

Commit

Permalink
fix #1344
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Jun 20, 2024
1 parent 25f6164 commit fda60cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
22 changes: 14 additions & 8 deletions core/Objects/Item.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1395,22 +1395,28 @@ public class Objects.Item : Objects.BaseObject {
}
} else if (duedate.recurrency_type == RecurrencyType.EVERY_WEEK) {
if (duedate.has_weeks) {
var today = Utils.Datetime.get_today_format_date ();
int day_of_week = today.get_day_of_week ();
int next_day = Utils.Datetime.get_next_day_of_week_from_recurrency_week (today, duedate);
GLib.DateTime due_selected = Utils.Datetime.get_today_format_date ();
if (has_due) {
due_selected = due.datetime;
}

int day_of_week = due_selected.get_day_of_week ();
int next_day = Utils.Datetime.get_next_day_of_week_from_recurrency_week (due_selected, duedate);
GLib.DateTime due_date = null;

if (day_of_week == next_day) {
due_date = today;
due_date = due_selected;
} else {
due_date = Utils.Datetime.next_recurrency_week (today, duedate);
due_date = Utils.Datetime.next_recurrency_week (due_selected, duedate);
}

due.date = Utils.Datetime.get_todoist_datetime_format (due_date);
} else {
due.date = Utils.Datetime.get_todoist_datetime_format (
Utils.Datetime.get_today_format_date ()
);
if (!has_due) {
due.date = Utils.Datetime.get_todoist_datetime_format (
Utils.Datetime.get_today_format_date ()
);
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/Dialogs/RepeatConfig.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public class Dialogs.RepeatConfig : Adw.Dialog {

public RepeatConfig () {
Object (
title: _("Repeat")
title: _("Repeat"),
content_width: 320
);
}

Expand Down

0 comments on commit fda60cd

Please sign in to comment.