Add support for getting day of the week to time module

This commit is contained in:
2023-05-17 16:04:10 +01:00
parent 8904f9ab8e
commit d84bb7ac4b
2 changed files with 65 additions and 2 deletions

View File

@@ -17,6 +17,16 @@ typedef struct {
unsigned day;
} Date;
typedef enum {
WEEK_DAY_MONDAY,
WEEK_DAY_TUESDAY,
WEEK_DAY_WEDNESDAY,
WEEK_DAY_THURSDAY,
WEEK_DAY_FRIDAY,
WEEK_DAY_SATURDAY,
WEEK_DAY_SUNDAY,
} WeekDay;
/**
* Initialize the time module.
*/
@@ -42,4 +52,14 @@ Date get_date(void);
*/
void set_date(Date date);
/**
* Get which day of the week it is.
*/
WeekDay get_week_day(void);
/**
* Get the name of a day of the week.
*/
const char *week_day_name(WeekDay day);
#endif