2025-09-18 06:03:02 +07:00
|
|
|
part of 'extension.dart';
|
|
|
|
|
|
|
|
|
|
extension DateTimeIndonesia on DateTime {
|
|
|
|
|
/// Format: 13 Agustus 2025
|
|
|
|
|
String get toDate {
|
|
|
|
|
return DateFormat('d MMMM yyyy', 'id_ID').format(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Format: 13 Agustus 2025 20:00
|
|
|
|
|
String get toDatetime {
|
|
|
|
|
return DateFormat('d MMMM yyyy HH:mm', 'id_ID').format(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Format: Rabu, 13 Agustus 2025
|
|
|
|
|
String get toDayDate {
|
|
|
|
|
return DateFormat('EEEE, d MMMM yyyy', 'id_ID').format(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Format: 13/08/2025
|
|
|
|
|
String get toShortDate {
|
|
|
|
|
return DateFormat('dd/MM/yyyy', 'id_ID').format(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Format: 13-08-2025
|
|
|
|
|
String get toServerDate {
|
2025-09-18 08:48:36 +07:00
|
|
|
return DateFormat('yyyy-MM-dd', 'id_ID').format(this);
|
2025-09-18 06:03:02 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Format jam: 14:30
|
|
|
|
|
String get toHourMinute {
|
|
|
|
|
return DateFormat('HH:mm', 'id_ID').format(this);
|
|
|
|
|
}
|
|
|
|
|
}
|