Browse Source

* Add AMPM to string, patch from closes #39973

marcoonthegit 2 years ago
parent
commit
f9a76aaa56
1 changed files with 7 additions and 1 deletions
  1. 7 1
      rtl/win/sysutils.pp

+ 7 - 1
rtl/win/sysutils.pp

@@ -1243,9 +1243,15 @@ begin
         HF:='h'
         HF:='h'
       else
       else
         HF:='hh';
         HF:='hh';
-      // No support for 12 hour stuff at the moment...
       ShortTimeFormat := HF+':nn';
       ShortTimeFormat := HF+':nn';
       LongTimeFormat := HF + ':nn:ss';
       LongTimeFormat := HF + ':nn:ss';
+      { 12-hour system support }
+      if GetLocaleInt(LID, LOCALE_ITIME, 1) = 0 then
+      begin
+        LongTimeFormat := LongTimeFormat + ' AMPM';
+        ShortTimeFormat := ShortTimeFormat + ' AMPM';
+      end;
+
       { Currency stuff }
       { Currency stuff }
       CurrencyString:=GetLocaleStr(LID, LOCALE_SCURRENCY, '');
       CurrencyString:=GetLocaleStr(LID, LOCALE_SCURRENCY, '');
       CurrencyFormat:=StrToIntDef(GetLocaleStr(LID, LOCALE_ICURRENCY, '0'), 0);
       CurrencyFormat:=StrToIntDef(GetLocaleStr(LID, LOCALE_ICURRENCY, '0'), 0);