mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 18:38:36 +08:00
Actually implement the Zettelkasten filename format
I like an idiot only exposed it in the Settings.
This commit is contained in:
@ -464,6 +464,8 @@ class Note with NotesNotifier {
|
|||||||
return toIso8601WithTimezone(date).replaceAll(":", "_");
|
return toIso8601WithTimezone(date).replaceAll(":", "_");
|
||||||
case NoteFileNameFormat.UuidV4:
|
case NoteFileNameFormat.UuidV4:
|
||||||
return Uuid().v4();
|
return Uuid().v4();
|
||||||
|
case NoteFileNameFormat.Zettelkasten:
|
||||||
|
return toZettleDateTime(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
return date.toString();
|
return date.toString();
|
||||||
|
@ -6,6 +6,7 @@ import 'package:gitjournal/utils/logger.dart';
|
|||||||
|
|
||||||
final _simpleDateFormat = DateFormat("yyyy-MM-dd-HH-mm-ss");
|
final _simpleDateFormat = DateFormat("yyyy-MM-dd-HH-mm-ss");
|
||||||
final _iso8601DateFormat = DateFormat("yyyy-MM-ddTHH:mm:ss");
|
final _iso8601DateFormat = DateFormat("yyyy-MM-ddTHH:mm:ss");
|
||||||
|
final _zettleDateFormat = DateFormat("yyyyMMddHHmss");
|
||||||
|
|
||||||
String toSimpleDateTime(DateTime dt) {
|
String toSimpleDateTime(DateTime dt) {
|
||||||
return _simpleDateFormat.format(dt);
|
return _simpleDateFormat.format(dt);
|
||||||
@ -15,6 +16,10 @@ String toIso8601(DateTime dt) {
|
|||||||
return _iso8601DateFormat.format(dt);
|
return _iso8601DateFormat.format(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String toZettleDateTime(DateTime dt) {
|
||||||
|
return _zettleDateFormat.format(dt);
|
||||||
|
}
|
||||||
|
|
||||||
String toIso8601WithTimezone(DateTime dt, [Duration offset]) {
|
String toIso8601WithTimezone(DateTime dt, [Duration offset]) {
|
||||||
var result = _iso8601DateFormat.format(dt);
|
var result = _iso8601DateFormat.format(dt);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user