dart format

This commit is contained in:
2026-05-08 20:12:40 +02:00
parent 9e139b5704
commit 3b8da1d3d6
295 changed files with 6404 additions and 4161 deletions
+16 -8
View File
@@ -2,11 +2,14 @@ import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
extension IsSameDay on DateTime {
bool isSameDay(DateTime other) => year == other.year && month == other.month && day == other.day;
bool isSameDay(DateTime other) =>
year == other.year && month == other.month && day == other.day;
DateTime nextWeekday(int day) => add(Duration(days: (day - weekday) % DateTime.daysPerWeek));
DateTime nextWeekday(int day) =>
add(Duration(days: (day - weekday) % DateTime.daysPerWeek));
DateTime withTime(TimeOfDay time) => copyWith(hour: time.hour, minute: time.minute);
DateTime withTime(TimeOfDay time) =>
copyWith(hour: time.hour, minute: time.minute);
TimeOfDay toTimeOfDay() => TimeOfDay(hour: hour, minute: minute);
@@ -25,15 +28,20 @@ extension IsSameDay on DateTime {
extension DateTimeFormatting on DateTime {
String formatHm() => Jiffy.parseFromDateTime(this).format(pattern: 'HH:mm');
String formatDate() => Jiffy.parseFromDateTime(this).format(pattern: 'dd.MM.yyyy');
String formatDate() =>
Jiffy.parseFromDateTime(this).format(pattern: 'dd.MM.yyyy');
String formatDateTime() => Jiffy.parseFromDateTime(this).format(pattern: 'dd.MM.yyyy HH:mm');
String formatDateTime() =>
Jiffy.parseFromDateTime(this).format(pattern: 'dd.MM.yyyy HH:mm');
String formatDateShort() => Jiffy.parseFromDateTime(this).format(pattern: 'dd.MM.');
String formatDateShort() =>
Jiffy.parseFromDateTime(this).format(pattern: 'dd.MM.');
String formatDateShortHm() => Jiffy.parseFromDateTime(this).format(pattern: 'dd.MM. HH:mm');
String formatDateShortHm() =>
Jiffy.parseFromDateTime(this).format(pattern: 'dd.MM. HH:mm');
String formatMonthYear() => Jiffy.parseFromDateTime(this).format(pattern: 'MMMM yyyy');
String formatMonthYear() =>
Jiffy.parseFromDateTime(this).format(pattern: 'MMMM yyyy');
String formatRelative() => Jiffy.parseFromDateTime(this).fromNow();