mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-05 11:13:18 +00:00
Fix date missing when editing task
This commit is contained in:
parent
62d90f26d3
commit
048d835bd6
2 changed files with 6 additions and 0 deletions
|
@ -125,6 +125,10 @@ void app_logic::setup_callbacks()
|
|||
auto task = source->get_task_by_id(taskId);
|
||||
assert(task);
|
||||
task->set_checked(!task->checked());
|
||||
if (!task->has_due_date()) {
|
||||
auto today = mirai::date(std::chrono::system_clock::now());
|
||||
task->set_date(today);
|
||||
}
|
||||
_mirai_core->save();
|
||||
update_views();
|
||||
});
|
||||
|
@ -186,6 +190,7 @@ void app_logic::setup_callbacks()
|
|||
const mirai::date &date = slint_date_to_mirai_date(newTaskData.date);
|
||||
// const auto dayOpt = source->get_day_by_date(date);
|
||||
task->set_title(std::string(newTaskData.title));
|
||||
task->set_date(slint_date_to_mirai_date(newTaskData.date));
|
||||
|
||||
_mirai_core->save();
|
||||
update_views();
|
||||
|
|
|
@ -113,6 +113,7 @@ export component MainView inherits Rectangle {
|
|||
padding-bottom: 8px;
|
||||
TaskLine {
|
||||
title: task.title;
|
||||
date: day.due-date;
|
||||
checked: task.checked;
|
||||
allow-edit-date: true;
|
||||
delete => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue