From 25eaeb9fea3c8162747fda137483759aba24c425 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Wed, 30 Dec 2015 15:39:44 +0100 Subject: [PATCH] Added spacial value @now as default-value in ZakFormElement. --- src/formelement.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/formelement.c b/src/formelement.c index 80491a8..26c6012 100644 --- a/src/formelement.c +++ b/src/formelement.c @@ -408,7 +408,15 @@ static gchar gchar *datetime_format; datetime_format = (gchar *)g_hash_table_lookup (format, "content"); - gdt = zak_utils_get_gdatetime_from_string (value, NULL); + + if (g_strcmp0 (value, "@now") == 0) + { + gdt = g_date_time_new_now_local (); + } + else + { + gdt = zak_utils_get_gdatetime_from_string (value, NULL); + } ret = zak_utils_gdatetime_format (gdt, datetime_format); if (gdt != NULL) -- 2.49.0