File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
lib/app/modules/taskc_details/controllers Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,22 @@ class TaskcDetailsController extends GetxController {
239239 final int nowEpoch = DateTime .now ().millisecondsSinceEpoch ~ / 1000 ;
240240 final modifiedTask = TaskForReplica (
241241 modified: nowEpoch,
242- due: due.string == '-' || due.string.isEmpty ? null : due.string,
242+ due: () {
243+ if (due.string == '-' || due.string.isEmpty) return null ;
244+ try {
245+ final parsed = DateFormat ('yyyy-MM-dd HH:mm:ss' ).parse (due.string);
246+ return parsed.toUtc ().toIso8601String ();
247+ } catch (e) {
248+ try {
249+ final parsed2 = DateTime .parse (due.string);
250+ return parsed2.toUtc ().toIso8601String ();
251+ } catch (_) {
252+ debugPrint (
253+ 'Could not parse due string for replica: ${due .string }' );
254+ return null ;
255+ }
256+ }
257+ }(),
243258 status: status.string.isNotEmpty ? status.string : null ,
244259 description: description.string.isNotEmpty ? description.string : null ,
245260 tags: tags.isNotEmpty ? tags.toList () : null ,
You can’t perform that action at this time.
0 commit comments