add: weekly schedules support
This commit is contained in:
parent
db3bcaf7d1
commit
2fd48ac5e6
18 changed files with 301 additions and 86 deletions
helpers
12
helpers/get_day_of_week.c
Normal file
12
helpers/get_day_of_week.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
#include <time.h>
|
||||
|
||||
#include <helpers.h>
|
||||
|
||||
int
|
||||
helper_get_weekday(const time_t timestamp_now)
|
||||
{
|
||||
struct tm *now = localtime(×tamp_now);
|
||||
int wday_sun_sat = now->tm_wday;
|
||||
int wday_mon_sun = (wday_sun_sat + 6) % 7;
|
||||
return wday_mon_sun;
|
||||
}
|
|
@ -18,7 +18,7 @@ static const char *const usage[] = {
|
|||
#define PERM_EXEC (1<<2)
|
||||
|
||||
void
|
||||
helpers_parse_cli(int argc, const char **argv, config_t *config)
|
||||
helper_parse_cli(int argc, const char **argv, config_t *config)
|
||||
{
|
||||
struct argparse_option options[] =
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue