#include <gio/gio.h>
#include <gtk/gtk.h>
-#include <libgdaex/libgdaex.h>
-#include <libgtkform/fielddatetime.h>
-
#include "solipa.h"
#include "utils.h"
return ret;
}
+struct tm
+*solipa_gdatetime_to_tm (GDateTime *gdatetime)
+{
+ struct tm *ret;
+
+ ret = g_new0 (struct tm, 1);
+ ret->tm_year = g_date_time_get_year (gdatetime) - 1900;
+ ret->tm_mon = g_date_time_get_month (gdatetime) - 1;
+ ret->tm_mday = g_date_time_get_day_of_week (gdatetime);
+ ret->tm_hour = g_date_time_get_hour (gdatetime);
+ ret->tm_min = g_date_time_get_minute (gdatetime);
+ ret->tm_sec = g_date_time_get_second (gdatetime);
+
+ return ret;
+}
+
const gchar
*solipa_tm_to_sql (struct tm *tm_data, const gchar *format)
{
*solipa_gtk_tree_model_get_value_tm (GtkTreeModel *model, GtkTreeIter *iter, gint column, const gchar *format)
{
struct tm *ret;
+ GDateTime *dt;
+
+ dt = solipa_gtk_tree_model_get_value_gdatetime (model, iter, column, format);
+
+ ret = solipa_gdatetime_to_tm (dt);
+
+ return ret;
+}
+
+GDateTime
+*solipa_gtk_tree_model_get_value_gdatetime (GtkTreeModel *model, GtkTreeIter *iter, gint column, const gchar *format)
+{
+ GDateTime *ret;
const gchar *value;
value = solipa_gtk_tree_model_get_value_string (model, iter, column);
- ret = gtk_form_field_datetime_get_tm_from_str (value, format);
+ ret = solipa_get_gdatetime_from_string (value, format);
return ret;
}
GDate *solipa_get_today_gdate (void);
GDateTime *solipa_tm_to_gdatetime (struct tm *tm_data);
+struct tm *solipa_gdatetime_to_tm (GDateTime *gdatetime);
const gchar *solipa_tm_to_sql (struct tm *tm_data, const gchar *format);
GDateTime *solipa_get_gdatetime_from_string (const gchar *string, const gchar *format);
gdouble solipa_gtk_tree_model_get_value_double (GtkTreeModel *model, GtkTreeIter *iter, gint column);
const gchar *solipa_gtk_tree_model_get_value_double_sql (GtkTreeModel *model, GtkTreeIter *iter, gint column);
struct tm *solipa_gtk_tree_model_get_value_tm (GtkTreeModel *model, GtkTreeIter *iter, gint column, const gchar *format);
+GDateTime *solipa_gtk_tree_model_get_value_gdatetime (GtkTreeModel *model, GtkTreeIter *iter, gint column, const gchar *format);
gboolean solipa_chk_codice_fiscale (const gchar *codice_fiscale, gboolean empty_good);
gboolean solipa_chk_partita_iva (const gchar *partita_iva, gboolean empty_good);