diff --git a/lib/note.dart b/lib/note.dart index c7b5f35e..5c7312fa 100644 --- a/lib/note.dart +++ b/lib/note.dart @@ -41,15 +41,13 @@ class Note implements Comparable { } } - // FIXME: Get created from file system or from git! - if (created == null) { - // FIXME: make this 0 - created = DateTime.now(); - } - json.remove("created"); } + if (created == null) { + created = DateTime(0, 0, 0, 0, 0, 0, 0, 0); + } + String body = ""; if (json.containsKey("body")) { body = json['body']; @@ -66,7 +64,10 @@ class Note implements Comparable { Map toJson() { var json = Map.from(extraProperties); - json['created'] = toIso8601WithTimezone(created); + var createdStr = toIso8601WithTimezone(created); + if (!createdStr.startsWith("00")) { + json['created'] = createdStr; + } json['body'] = body; json['fileName'] = fileName;