...
 
Commits (1)
  • Rob Swindell's avatar
    New birthdate format: YYYMMDD · c3a87fe1
    Rob Swindell authored
    Also, fixed get_date(), it returns 0 on success, but the success return logic was inverted:
    it only returned 0 if the date was unchanged from the previous value.
    
    Note:
    It would be nice if this user editor prompted to save changes if changes have been made a new
    user is selected (e.g. with the arrow buttons).
    c3a87fe1
......@@ -2050,7 +2050,7 @@ int get_date(GtkWidget *t, isoDate_t *date)
gtk_calendar_get_date(GTK_CALENDAR(w), &year, &month, &day);
gtk_widget_hide(GTK_WIDGET(gtk_widget_get_toplevel(GTK_WIDGET(w))));
*date=isoDate_create(year, month+1, day);
return(odate!=*date);
return odate == *date;
}
G_MODULE_EXPORT void get_expiration(GtkWidget *t, gpointer data)
......@@ -2094,18 +2094,19 @@ G_MODULE_EXPORT void get_birthdate(GtkWidget *t, gpointer data)
GtkWidget *w;
int year;
year=atoi(user.birth+6)+1900;
if(year<Y2K_2DIGIT_WINDOW)
year+=100;
if(cfg.sys_misc&SM_EURODATE)
date=isoDate_create(year, atoi(user.birth+3), atoi(user.birth));
else
date=isoDate_create(year, atoi(user.birth), atoi(user.birth+3));
if(!get_date(t, &date)) {
if(user.birth[2] == '/') {
year=atoi(user.birth+6)+1900;
if(year<Y2K_2DIGIT_WINDOW)
year+=100;
if(cfg.sys_misc&SM_EURODATE)
sprintf(user.birth,"%02u/%02u/%02u",isoDate_day(date),isoDate_month(date),isoDate_year(date)%100);
date=isoDate_create(year, atoi(user.birth+3), atoi(user.birth));
else
sprintf(user.birth,"%02u/%02u/%02u",isoDate_month(date),isoDate_day(date),isoDate_year(date)%100);
date=isoDate_create(year, atoi(user.birth), atoi(user.birth+3));
} else
date = atoi(user.birth);
if(!get_date(t, &date)) {
SAFEPRINTF3(user.birth,"%04u%02u%02u",isoDate_year(date),isoDate_month(date),isoDate_day(date));
user_changed(t, data);
w=GTK_WIDGET(gtk_builder_get_object(builder, "eBirthdate"));
if(w==NULL)
......