TF-801 Add presentation layer for get all vacation

This commit is contained in:
dab246
2022-08-17 17:37:18 +07:00
committed by Dat H. Pham
parent 8ab4e7bfc0
commit aa139eb112
33 changed files with 1240 additions and 38 deletions
@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
extension DateTimeExtension on DateTime? {
String formatDate({String pattern = 'yyyy/MM/dd', String locale = 'en_US'}) {
if (this != null) {
return DateFormat(pattern, locale).format(this!.toLocal());
} else {
return '';
}
}
}
extension TimeOfDayExtension on TimeOfDay? {
String formatTime(BuildContext context) {
if (this != null) {
return this!.format(context);
}
return '';
}
}