Add support for getting day of the week to time module
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user