Add minus sign (U+2212) as a time zone offset indicator
This commit is contained in:
		
				
					committed by
					
						 Dimitri Schoolwerth
						Dimitri Schoolwerth
					
				
			
			
				
	
			
			
			
						parent
						
							1a5163a882
						
					
				
				
					commit
					af309e6d96
				
			| @@ -1497,12 +1497,19 @@ wxDateTime::ParseFormat(const wxString& date, | ||||
|                         break; | ||||
|                     } | ||||
|  | ||||
|                     // and then check that it's either plus or minus sign | ||||
|                     // Check if there's either a plus, hyphen-minus, or | ||||
|                     // minus sign. | ||||
|                     bool minusFound; | ||||
|                     if ( *input == wxT('-') ) | ||||
|                         minusFound = true; | ||||
|                     else if ( *input == wxT('+') ) | ||||
|                     if ( *input == wxS('+') ) | ||||
|                         minusFound = false; | ||||
|                     else if | ||||
|                     ( | ||||
|                         *input == wxS('-') | ||||
| #if wxUSE_UNICODE | ||||
|                         || *input == wxString::FromUTF8("\xe2\x88\x92") | ||||
| #endif | ||||
|                     ) | ||||
|                         minusFound = true; | ||||
|                     else | ||||
|                         return false;   // no match | ||||
|  | ||||
|   | ||||
| @@ -918,6 +918,11 @@ void DateTimeTestCase::TestTimeZoneParse() | ||||
|         { "09:07-04:30", true }, | ||||
|         { "19:22+05:45", true }, | ||||
|  | ||||
| #if wxUSE_UNICODE | ||||
|         // Containing minus sign (U+2212) as separator between time and tz. | ||||
|         { "09:37" "\xe2\x88\x92" "0400", true }, | ||||
| #endif | ||||
|  | ||||
|         // Some invalid ones too. | ||||
|  | ||||
|         { "00:00-1300" }, // Offset out of range. | ||||
| @@ -937,7 +942,7 @@ void DateTimeTestCase::TestTimeZoneParse() | ||||
|     for ( size_t n = 0; n < WXSIZEOF(parseTestTimeZones); ++n ) | ||||
|     { | ||||
|         wxDateTime dt; | ||||
|         wxString sTimeZone = parseTestTimeZones[n].str; | ||||
|         wxString sTimeZone = wxString::FromUTF8(parseTestTimeZones[n].str); | ||||
|         wxString::const_iterator end; | ||||
|         if ( dt.ParseFormat(sTimeZone, wxS("%H:%M%z"), &end) | ||||
|              && end == sTimeZone.end() ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user