-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #346 from AOSSIE-Org/Update-live-room-and-upcommin…
…g-room-tiles Update live room and upcoming room tiles
- Loading branch information
Showing
11 changed files
with
533 additions
and
1,139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import 'dart:ui'; | ||
|
||
import 'package:intl/intl.dart'; | ||
|
||
extension DateTimeExtensions on DateTime { | ||
String dateToLocalFormatted(Locale locale) { | ||
final localDateTime = toLocal(); | ||
|
||
final localDate = DateFormat.yMd().format(localDateTime); | ||
|
||
String localTime = DateFormat.jm().format(localDateTime); | ||
|
||
if (locale.languageCode == 'ht') { | ||
final timePeriod = localDateTime.hour < 12 ? 'AM' : 'PM'; | ||
localTime = | ||
DateFormat.jm(locale.languageCode).format(localDateTime) + timePeriod; | ||
} | ||
|
||
return '$localDate $localTime'; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.