mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(mobile): image thumbnails (#19821)
* image thumbnail refactor * minor const-ification in new thumbnail tile * underscore helper classes --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
parent
a918481c0b
commit
fd48a33686
6 changed files with 317 additions and 228 deletions
|
|
@ -3,3 +3,15 @@ extension TZOffsetExtension on Duration {
|
|||
String formatAsOffset() =>
|
||||
"${isNegative ? '-' : '+'}${inHours.abs().toString().padLeft(2, '0')}:${inMinutes.abs().remainder(60).toString().padLeft(2, '0')}";
|
||||
}
|
||||
|
||||
extension DurationFormatExtension on Duration {
|
||||
String format() {
|
||||
final seconds = inSeconds.remainder(60).toString().padLeft(2, '0');
|
||||
final minutes = inMinutes.remainder(60).toString().padLeft(2, '0');
|
||||
if (inHours == 0) {
|
||||
return "$minutes:$seconds";
|
||||
}
|
||||
final hours = inHours.toString().padLeft(2, '0');
|
||||
return "$hours:$minutes:$seconds";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue