Tasks
This commit is contained in:
parent
e56e1cf7fb
commit
6146713ede
|
|
@ -155,7 +155,7 @@ abstract class TaskTime implements Built<TaskTime, TaskTimeBuilder> {
|
||||||
}
|
}
|
||||||
|
|
||||||
final dateTime = DateTime.parse(date);
|
final dateTime = DateTime.parse(date);
|
||||||
final now = DateTime.now();
|
final now = DateTime.now().toUtc();
|
||||||
|
|
||||||
return TaskTime(
|
return TaskTime(
|
||||||
startDate: DateTime.utc(
|
startDate: DateTime.utc(
|
||||||
|
|
@ -176,7 +176,7 @@ abstract class TaskTime implements Built<TaskTime, TaskTimeBuilder> {
|
||||||
}
|
}
|
||||||
|
|
||||||
final dateTime = DateTime.parse(date);
|
final dateTime = DateTime.parse(date);
|
||||||
final now = DateTime.now();
|
final now = DateTime.now().toUtc();
|
||||||
|
|
||||||
return TaskTime(
|
return TaskTime(
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ class _TaskEditDesktopState extends State<TaskEditDesktop> {
|
||||||
int _updatedAt = 0;
|
int _updatedAt = 0;
|
||||||
int _startDateUpdatedAt = 0;
|
int _startDateUpdatedAt = 0;
|
||||||
int _startTimeUpdatedAt = 0;
|
int _startTimeUpdatedAt = 0;
|
||||||
|
int _endDateUpdatedAt = 0;
|
||||||
int _endTimeUpdatedAt = 0;
|
int _endTimeUpdatedAt = 0;
|
||||||
int _durationUpdateAt = 0;
|
int _durationUpdateAt = 0;
|
||||||
|
|
||||||
|
|
@ -346,13 +347,18 @@ class _TaskEditDesktopState extends State<TaskEditDesktop> {
|
||||||
final taskTime =
|
final taskTime =
|
||||||
taskTimes[index].copyWithEndDate(date);
|
taskTimes[index].copyWithEndDate(date);
|
||||||
viewModel.onUpdatedTaskTime(taskTime, index);
|
viewModel.onUpdatedTaskTime(taskTime, index);
|
||||||
|
setState(() {
|
||||||
|
_endDateUpdatedAt =
|
||||||
|
DateTime.now().millisecondsSinceEpoch;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(right: kTableColumnGap),
|
padding: const EdgeInsets.only(right: kTableColumnGap),
|
||||||
child: TimePicker(
|
child: TimePicker(
|
||||||
key: ValueKey('__${_durationUpdateAt}_${index}__'),
|
key: ValueKey(
|
||||||
|
'__${_endDateUpdatedAt}_${_durationUpdateAt}_${index}__'),
|
||||||
selectedDateTime: taskTimes[index].endDate,
|
selectedDateTime: taskTimes[index].endDate,
|
||||||
isEndTime: true,
|
isEndTime: true,
|
||||||
onSelected: (timeOfDay) {
|
onSelected: (timeOfDay) {
|
||||||
|
|
@ -370,7 +376,7 @@ class _TaskEditDesktopState extends State<TaskEditDesktop> {
|
||||||
padding: const EdgeInsets.only(right: kTableColumnGap),
|
padding: const EdgeInsets.only(right: kTableColumnGap),
|
||||||
child: DurationPicker(
|
child: DurationPicker(
|
||||||
key: ValueKey(
|
key: ValueKey(
|
||||||
'__${_startTimeUpdatedAt}_${_endTimeUpdatedAt}_${_startDateUpdatedAt}_${index}__'),
|
'__${_startTimeUpdatedAt}_${_endTimeUpdatedAt}_${_startDateUpdatedAt}_${_endDateUpdatedAt}_${index}__'),
|
||||||
onSelected: (Duration duration) {
|
onSelected: (Duration duration) {
|
||||||
final taskTime =
|
final taskTime =
|
||||||
taskTimes[index].copyWithDuration(duration);
|
taskTimes[index].copyWithDuration(duration);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue