Display the full month in billing details

This commit is contained in:
Vishnu Mohandas 2020-08-29 09:34:59 +05:30
parent 8dc5bad44c
commit 81db6e73d1
2 changed files with 20 additions and 1 deletions

View file

@ -75,7 +75,7 @@ class UsageWidgetState extends State<UsageWidget> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Tentative bill for " + getMonth(DateTime.now())),
Text("Tentative bill for " + getFullMonth(DateTime.now())),
_usageInGBs == null ? loadWidget : _getCost(_usageInGBs),
],
)

View file

@ -13,6 +13,21 @@ Map<int, String> _months = {
12: "Dec",
};
Map<int, String> _fullMonths = {
1: "January",
2: "February",
3: "March",
4: "April",
5: "May",
6: "June",
7: "July",
8: "August",
9: "September",
10: "October",
11: "November",
12: "December",
};
Map<int, String> _days = {
1: "Mon",
2: "Tue",
@ -43,6 +58,10 @@ String getMonth(DateTime dateTime) {
return _months[dateTime.month];
}
String getFullMonth(DateTime dateTime) {
return _fullMonths[dateTime.month];
}
String getTime(DateTime dateTime) {
final hours = dateTime.hour > 9
? dateTime.hour.toString()