mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-06 11:33: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);
|
auto task = source->get_task_by_id(taskId);
|
||||||
assert(task);
|
assert(task);
|
||||||
task->set_checked(!task->checked());
|
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();
|
_mirai_core->save();
|
||||||
update_views();
|
update_views();
|
||||||
});
|
});
|
||||||
|
@ -186,6 +190,7 @@ void app_logic::setup_callbacks()
|
||||||
const mirai::date &date = slint_date_to_mirai_date(newTaskData.date);
|
const mirai::date &date = slint_date_to_mirai_date(newTaskData.date);
|
||||||
// const auto dayOpt = source->get_day_by_date(date);
|
// const auto dayOpt = source->get_day_by_date(date);
|
||||||
task->set_title(std::string(newTaskData.title));
|
task->set_title(std::string(newTaskData.title));
|
||||||
|
task->set_date(slint_date_to_mirai_date(newTaskData.date));
|
||||||
|
|
||||||
_mirai_core->save();
|
_mirai_core->save();
|
||||||
update_views();
|
update_views();
|
||||||
|
|
|
@ -113,6 +113,7 @@ export component MainView inherits Rectangle {
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
TaskLine {
|
TaskLine {
|
||||||
title: task.title;
|
title: task.title;
|
||||||
|
date: day.due-date;
|
||||||
checked: task.checked;
|
checked: task.checked;
|
||||||
allow-edit-date: true;
|
allow-edit-date: true;
|
||||||
delete => {
|
delete => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue