mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
[test] Update test
This commit is contained in:
@ -86,6 +86,8 @@ namespace ParseAllCultureInfo
|
||||
public string TimeSeparator;
|
||||
[DataMember]
|
||||
public string ShortDatePattern;
|
||||
[DataMember]
|
||||
public string LongDatePattern;
|
||||
public ParamsSerializable(CultureInfo ci)
|
||||
{
|
||||
LCID = ci.LCID;
|
||||
@ -174,6 +176,7 @@ namespace ParseAllCultureInfo
|
||||
}
|
||||
}
|
||||
ShortDatePattern = sShortDatePattern;
|
||||
LongDatePattern = parseLongDate(ci.DateTimeFormat.LongDatePattern);
|
||||
}
|
||||
}
|
||||
static Dictionary<int, int> g_mapUsedValues = new Dictionary<int, int>() {
|
||||
@ -306,6 +309,40 @@ namespace ParseAllCultureInfo
|
||||
{31748, 1},
|
||||
{31824, 1}
|
||||
};
|
||||
public static string parseLongDate(string format)
|
||||
{
|
||||
format = format.ToLower();
|
||||
string res = "";
|
||||
for(var i = 0; i < format.Length; ++i)
|
||||
{
|
||||
switch(format[i])
|
||||
{
|
||||
case 'd':
|
||||
case 'g':
|
||||
case 'h':
|
||||
case 'm':
|
||||
case 's':
|
||||
case 'y':
|
||||
case ':':
|
||||
case '/':
|
||||
res += format[i];
|
||||
break;
|
||||
case '\\':
|
||||
res += "\\\\" + format[i+1];
|
||||
i++;
|
||||
break;
|
||||
case '\'':
|
||||
case '\"':
|
||||
res += "\\\"" + format.Substring(i + 1, format.IndexOf(format[i], i+1) - i - 1) + "\\\"";
|
||||
i = format.IndexOf(format[i], i + 1);
|
||||
break;
|
||||
default:
|
||||
res += "\\\\" + format[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public static void parse()
|
||||
{
|
||||
List<int> aLcid = new List<int>();
|
||||
|
||||
Reference in New Issue
Block a user