diff --git a/source/libublsettings-gtk3.c b/source/libublsettings-gtk3.c index 4712085..1a1a431 100644 --- a/source/libublsettings-gtk3.c +++ b/source/libublsettings-gtk3.c @@ -1176,6 +1176,12 @@ gboolean yon_gtk_tree_iter_get_from_combo_box_id(GtkComboBox *combo, GtkTreeMode int yon_calendar_set_orientation = 0; +int yon_calendar_last_date = 0; + +int yon_calendar_get_last_date(){ + return yon_calendar_last_date; +} + void yon_calendar_set_date_orientation(int orientation){ yon_calendar_set_orientation = orientation; } @@ -1196,9 +1202,11 @@ void yon_on_date_selected(GtkWidget *self,GtkWidget *target){ int comparison = g_date_time_compare(current_datetime,datetime); if ((comparison <0&&yon_calendar_set_orientation>0)||(comparison>0&&yon_calendar_set_orientation<0)){ gtk_entry_set_text(GTK_ENTRY(target),g_date_time_format(datetime,"%Y-%m-%d")); + yon_calendar_last_date = g_date_time_to_unix(datetime); } else { char *date_string = yon_char_unite(yr,"-",mn,"-",dy,NULL); gtk_entry_set_text(GTK_ENTRY(target), date_string); + yon_calendar_last_date = g_date_time_to_unix(current_datetime); } free(dy); free(mn); diff --git a/source/libublsettings-gtk3.h b/source/libublsettings-gtk3.h index ea45a40..8c965d7 100644 --- a/source/libublsettings-gtk3.h +++ b/source/libublsettings-gtk3.h @@ -473,4 +473,6 @@ gboolean yon_gtk_tree_iter_get_from_combo_box_id(GtkComboBox *combo, GtkTreeMode void yon_calendar_set_date_orientation(int orientation); -void yon_calendar_popover_open(GtkEntry *TargetEntry,GtkWidget *PopupTarget); \ No newline at end of file +void yon_calendar_popover_open(GtkEntry *TargetEntry,GtkWidget *PopupTarget); + +int yon_calendar_get_last_date(); \ No newline at end of file