summaryrefslogtreecommitdiff
path: root/src/config_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config_time.c')
-rw-r--r--src/config_time.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config_time.c b/src/config_time.c
index d6931ff..39c8427 100644
--- a/src/config_time.c
+++ b/src/config_time.c
@@ -22,12 +22,16 @@ void config_time_init(struct node* n) {
n->type = CTYPE_TIME;
n->loadfunc = &config_time_load;
n->loadkey = &load_time_key;
+
+ strcpy(((struct config_time*) n->data)->fmt, "%T");
}
void load_time_key(struct node* n, char* key, char* val) {
if(strcmp(key, "tz") == 0)
strcpy(((struct config_time*) n->data)->tz, val);
+ else if(strcmp(key, "fmt") == 0)
+ strcpy(((struct config_time*) n->data)->fmt, val);
else
printf("ERROR: Unknown time key %s\n", key);
}
@@ -41,7 +45,7 @@ int config_time_load(struct node* n) {
time(&timep);
info = localtime(&timep);
- strftime(n->text, 256, "%T", info);
+ strftime(n->text, 256, ((struct config_time*)n->data)->fmt, info);
strcpy(n->color, C_DGREY);
strcpy(n->label_color, C_LGREY);

Generated by cgit