From: Andrea Zagli Date: Wed, 30 Dec 2015 14:39:44 +0000 (+0100) Subject: Added spacial value @now as default-value in ZakFormElement. X-Git-Tag: debian/0.0.1-1~16 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=25eaeb9fea3c8162747fda137483759aba24c425;p=zakform%2Flibzakform Added spacial value @now as default-value in ZakFormElement. --- 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)