diff options
Diffstat (limited to 'data_model/DataHelpers.gd')
-rw-r--r-- | data_model/DataHelpers.gd | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/data_model/DataHelpers.gd b/data_model/DataHelpers.gd index 86a05de..3db382e 100644 --- a/data_model/DataHelpers.gd +++ b/data_model/DataHelpers.gd @@ -1,26 +1,26 @@ -class_name DataHelpers
-
-static func dummy_data(data):
- return data
-
-static func timeofday(time):
- time += (Time.get_time_zone_from_system().bias * 60)
- time = Time.get_time_dict_from_unix_time(time)
- var hour = time.hour
- var minute = time.minute
- var am = hour < 12
- hour = hour % 12
- if hour == 0:
- hour = 12
- var string = "%2d:%02d %s"
- return string % [hour, minute, "AM" if am else "PM"]
-
-enum Frequency {DAILY, EVERY_OTHER_DAY, WEEKLY, BI_WEEKLY, MONTHLY, SIZE}
-static func frequency(freq):
- match freq:
- Frequency.DAILY: return "Daily"
- Frequency.EVERY_OTHER_DAY: return "Every\nOther Day"
- Frequency.WEEKLY: return "Weekly"
- Frequency.BI_WEEKLY: return "Bi-Weekly"
- Frequency.MONTHLY: return "Monthly"
- _: return ""
+class_name DataHelpers + +static func dummy_data(data): + return data + +static func timeofday(time): + time += (Time.get_time_zone_from_system().bias * 60) + time = Time.get_time_dict_from_unix_time(time) + var hour = time.hour + var minute = time.minute + var am = hour < 12 + hour = hour % 12 + if hour == 0: + hour = 12 + var string = "%2d:%02d %s" + return string % [hour, minute, "AM" if am else "PM"] + +enum Frequency {DAILY, EVERY_OTHER_DAY, WEEKLY, BI_WEEKLY, MONTHLY, SIZE} +static func frequency(freq): + match freq: + Frequency.DAILY: return "Daily" + Frequency.EVERY_OTHER_DAY: return "Every\nOther Day" + Frequency.WEEKLY: return "Weekly" + Frequency.BI_WEEKLY: return "Bi-Weekly" + Frequency.MONTHLY: return "Monthly" + _: return "" |