Datetime fix, take 2

Duane Clark dclark at akamail.com
Thu Apr 14 14:17:48 CDT 2005


This supercedes the previous "Datetime scroll fixes". I had not noticed 
that Robert had fixed two of my bugs ;) Thanks.

Changelog:
	Hour '0' corresponds to 12AM.

-------------- next part --------------
Index: dlls/comctl32/datetime.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/datetime.c,v
retrieving revision 1.55
diff -u -p -r1.55 datetime.c
--- dlls/comctl32/datetime.c	14 Apr 2005 11:31:17 -0000	1.55
+++ dlls/comctl32/datetime.c	14 Apr 2005 18:20:35 -0000
@@ -339,10 +339,22 @@ DATETIME_ReturnTxt (DATETIME_INFO *infoP
 	    GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME1+(date.wDayOfWeek+6)%7, result, resultSize);
 	    break;
 	case ONEDIGIT12HOUR:
-	    wsprintfW (result, fmt_dW, date.wHour - (date.wHour > 12 ? 12 : 0));
+	    if (date.wHour == 0) {
+	        result[0] = '1';
+	        result[1] = '2';
+	        result[2] = 0;
+	    }
+	    else
+	        wsprintfW (result, fmt_dW, date.wHour - (date.wHour > 12 ? 12 : 0));
 	    break;
 	case TWODIGIT12HOUR:
-	    wsprintfW (result, fmt__2dW, date.wHour - (date.wHour > 12 ? 12 : 0));
+	    if (date.wHour == 0) {
+	        result[0] = '1';
+	        result[1] = '2';
+	        result[2] = 0;
+	    }
+	    else
+	        wsprintfW (result, fmt__2dW, date.wHour - (date.wHour > 12 ? 12 : 0));
 	    break;
 	case ONEDIGIT24HOUR:
 	    wsprintfW (result, fmt_dW, date.wHour);


More information about the wine-patches mailing list