Filename: Use iso8601 string

This sucks balls. Overall, the datetime handling in Dart is really
really bad. It just has the concept of local time or utc time. There are
a few packages which attempt to solve this, but none which really solve
it in the way I would like.

All I want is someway to generate an iso8601 string with the timezone.
And that my DateTime should be aware of the timezone as an offset east
of UTC. Is that really so hard?
This commit is contained in:
Vishesh Handa
2019-01-15 14:37:13 +01:00
parent fc40e4cef1
commit 04b65fbf95
2 changed files with 3 additions and 1 deletions

View File

@ -49,6 +49,7 @@ class StateContainerState extends State<StateContainer> {
getDirectory: getNotesDir,
dirName: "journal",
gitCloneUrl: "root@bcn.vhanda.in:git/test",
fileNameGenerator: (Note n) => n.created.toIso8601String(),
);
StateContainerState(bool onBoardingCompleted) {

View File

@ -24,9 +24,10 @@ class GitNoteRepository implements NoteRepository {
@required this.gitCloneUrl,
@required this.dirName,
@required this.getDirectory,
@required fileNameGenerator,
}) : _fileStorage = FileStorage(
noteSerializer: new MarkdownYAMLSerializer(),
fileNameGenerator: (Note note) => note.id,
fileNameGenerator: fileNameGenerator,
getDirectory: getDirectory,
) {
// FIXME: This isn't correct. The gitUrl might not be cloned at this point!