diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 20:43:03 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-08-26 20:43:03 -0400 |
commit | 6963eb6cb0f7d15c97f44b9ca439be321edb8a8f (patch) | |
tree | 190990c2497d7f0ad8b2cfed87bab53bff496fbf /data_model/DataHelpers.gd | |
parent | 5756a8f8ed23f0af88b9a351fbbde7417ac82c2f (diff) | |
download | Planner-6963eb6cb0f7d15c97f44b9ca439be321edb8a8f.tar.gz Planner-6963eb6cb0f7d15c97f44b9ca439be321edb8a8f.zip |
accidentally wasn't tracking any of the data model objects
Diffstat (limited to 'data_model/DataHelpers.gd')
-rw-r--r-- | data_model/DataHelpers.gd | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/data_model/DataHelpers.gd b/data_model/DataHelpers.gd new file mode 100644 index 0000000..9e8d7cd --- /dev/null +++ b/data_model/DataHelpers.gd @@ -0,0 +1,24 @@ +class_name DataHelpers
+
+static func dummy_data(data):
+ return data
+
+static func timeofday(time):
+ var hour = time / 60
+ var minute = time % 60
+ 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 ""
|