mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
extracted reusable helper methods into global extensions.
This commit is contained in:
19
lib/pages/analytics/helpers/get_month_name_from_int.dart
Normal file
19
lib/pages/analytics/helpers/get_month_name_from_int.dart
Normal file
@ -0,0 +1,19 @@
|
||||
extension GetMonthNameFromNumber on num {
|
||||
String get getMonthName {
|
||||
return switch (this) {
|
||||
1 => 'JAN',
|
||||
2 => 'FEB',
|
||||
3 => 'MAR',
|
||||
4 => 'APR',
|
||||
5 => 'MAY',
|
||||
6 => 'JUN',
|
||||
7 => 'JUL',
|
||||
8 => 'AUG',
|
||||
9 => 'SEP',
|
||||
10 => 'OCT',
|
||||
11 => 'NOV',
|
||||
12 => 'DEC',
|
||||
_ => 'N/A'
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user