Skip to content

Commit

Permalink
Merge pull request #10 from vicolo-dev/enhancement-add-date-fmts
Browse files Browse the repository at this point in the history
Add more date formats
  • Loading branch information
AhsanSarwar45 authored Dec 15, 2023
2 parents 925c5c6 + 9405b12 commit 55d646d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/common/utils/date_time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ extension DateTimeUtils on DateTime {
month == tomorrow.month &&
day == tomorrow.day;
}

String toIso8601Date() => toIso8601String().substring(0, 10);
}
14 changes: 12 additions & 2 deletions lib/settings/data/settings_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:clock_app/alarm/widgets/notification_actions/buttons_notificatio
import 'package:clock_app/alarm/widgets/notification_actions/slide_notification_action.dart';
import 'package:clock_app/app.dart';
import 'package:clock_app/clock/types/time.dart';
import 'package:clock_app/common/utils/date_time.dart';
import 'package:clock_app/icons/flux_icons.dart';
import 'package:clock_app/settings/screens/vendor_list_screen.dart';
import 'package:clock_app/settings/types/setting.dart';
Expand Down Expand Up @@ -43,13 +44,22 @@ SettingGroup appSettings = SettingGroup(
"Date Format",
() => [
_getDateSettingOption("dd/MM/yyyy"),
_getDateSettingOption("dd/MM/yyyy"),
_getDateSettingOption("dd-MM-yyyy"),
_getDateSettingOption("d/M/yyyy"),
_getDateSettingOption("d-M-yyyy"),
_getDateSettingOption("MM/dd/yyyy"),
_getDateSettingOption("MM-dd-yyyy"),
_getDateSettingOption("M/d/yy"),
_getDateSettingOption("M-d-yy"),
_getDateSettingOption("M/d/yyyy"),
_getDateSettingOption("M-d-yyyy"),
_getDateSettingOption("yyyy/dd/MM"),
_getDateSettingOption("yyyy-dd-MM"),
_getDateSettingOption("d-MMM-yyyy"),
_getDateSettingOption("yyyy/MM/dd"),
_getDateSettingOption("yyyy-MM-dd"),
// SelectSettingOption(DateTime.now().toIso8601Date(), "YYYY-MM-DD"),
_getDateSettingOption("d MMM yyyy"),
_getDateSettingOption("d MMMM yyyy"),
],
description: "How to display the dates",
),
Expand Down

0 comments on commit 55d646d

Please sign in to comment.