1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-22 01:47:08 +02:00
immich/mobile/lib/extensions/duration_extensions.dart

6 lines
263 B
Dart
Raw Normal View History

extension TZOffsetExtension on Duration {
/// Formats the duration in the format of ±HH:MM
String formatAsOffset() =>
"${isNegative ? '-' : '+'}${inHours.abs().toString().padLeft(2, '0')}:${inMinutes.abs().remainder(60).toString().padLeft(2, '0')}";
}