{
gdt_tmp = g_date_time_new_now_local ();
- if (priv->type == GTK_FORM_FIELD_DATETIME_TYPE_DATE)
+ switch (priv->type)
{
- gdt_min_value = g_date_time_new_local (g_date_time_get_year (gdt_tmp),
- g_date_time_get_month (gdt_tmp),
- g_date_time_get_day_of_month (gdt_tmp),
- 0, 0, 0.0);
+ case GTK_FORM_FIELD_DATETIME_TYPE_DATE:
+ gdt_min_value = g_date_time_new_local (g_date_time_get_year (gdt_tmp),
+ g_date_time_get_month (gdt_tmp),
+ g_date_time_get_day_of_month (gdt_tmp),
+ 0, 0, 0.0);
+ break;
+
+ case GTK_FORM_FIELD_DATETIME_TYPE_TIME:
+ gdt_min_value = g_date_time_new_local (1, 1, 1,
+ g_date_time_get_hour (gdt_tmp),
+ g_date_time_get_minute (gdt_tmp),
+ g_date_time_get_seconds (gdt_tmp));
+ break;
+
+ default:
+ gdt_min_value = g_date_time_ref (gdt_tmp);
+ break;
}
- else if (priv->type == GTK_FORM_FIELD_DATETIME_TYPE_TIME)
- {
- gdt_min_value = g_date_time_new_local (1, 1, 1,
- g_date_time_get_hour (gdt_tmp),
- g_date_time_get_minute (gdt_tmp),
- g_date_time_get_seconds (gdt_tmp));
- }
- gdt_min_value = g_date_time_ref (gdt_tmp);
g_date_time_unref (gdt_tmp);
}
else
{
gdt_tmp = g_date_time_new_now_local ();
- if (priv->type == GTK_FORM_FIELD_DATETIME_TYPE_DATE)
- {
- gdt_max_value = g_date_time_new_local (g_date_time_get_year (gdt_tmp),
- g_date_time_get_month (gdt_tmp),
- g_date_time_get_day_of_month (gdt_tmp),
- 0, 0, 0.0);
- }
- else if (priv->type == GTK_FORM_FIELD_DATETIME_TYPE_TIME)
+ switch (priv->type)
{
- gdt_max_value = g_date_time_new_local (1, 1, 1,
- g_date_time_get_hour (gdt_tmp),
- g_date_time_get_minute (gdt_tmp),
- g_date_time_get_seconds (gdt_tmp));
+ case GTK_FORM_FIELD_DATETIME_TYPE_DATE:
+ gdt_max_value = g_date_time_new_local (g_date_time_get_year (gdt_tmp),
+ g_date_time_get_month (gdt_tmp),
+ g_date_time_get_day_of_month (gdt_tmp),
+ 0, 0, 0.0);
+ break;
+
+ case GTK_FORM_FIELD_DATETIME_TYPE_TIME:
+ gdt_max_value = g_date_time_new_local (1, 1, 1,
+ g_date_time_get_hour (gdt_tmp),
+ g_date_time_get_minute (gdt_tmp),
+ g_date_time_get_seconds (gdt_tmp));
+ break;
+
+ default:
+ gdt_max_value = g_date_time_ref (gdt_tmp);
+ break;
}
- gdt_max_value = g_date_time_ref (gdt_tmp);
g_date_time_unref (gdt_tmp);
}
else