aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index 1a480df..2d30bfc 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2020 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -626,6 +626,42 @@ long min2sec(unsigned minutes)
return minutes * MININSEC;
}
+int modify_wday(int wday, int shift)
+{
+ return (WEEKINDAYS + wday + shift) % WEEKINDAYS;
+}
+
+/* returns char* representing a wday, used for internal functions */
+char *get_wday_default_string(int wday)
+{
+ switch(wday) {
+ case MONDAY:
+ return "Monday";
+ break;
+ case TUESDAY:
+ return "Tuesday";
+ break;
+ case WEDNESDAY:
+ return "Wednesday";
+ break;
+ case THURSDAY:
+ return "Thursday";
+ break;
+ case FRIDAY:
+ return "Friday";
+ break;
+ case SATURDAY:
+ return "Saturday";
+ break;
+ case SUNDAY:
+ return "Sunday";
+ break;
+ default:
+ return "Sunday";
+ break;
+ }
+}
+
/*
* Display a scroll bar when there are so many items that they
* can not be displayed inside the corresponding panel.