You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

176 lines
5.3 KiB

namespace com.hitrust.b2b.trustpay.client
{
using System;
using System.Globalization;
public class HiCalendar : GregorianCalendar
{
public static readonly int DATE = 2;
public static readonly int HOUR = 3;
public static readonly int MINUTE = 4;
public static readonly int MONTH = 1;
public static readonly int SECOND = 5;
protected internal static string[] sLocalMonthName = new string[] {"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"};
protected internal static string[] sLocalShortMonthName = new string[] {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"};
protected internal static string[] sLocalShortWeekName = new string[] {"日", "一", "二", "三", "四", "五", "六"};
protected internal static string[] sLocalWeekName = new string[] {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
protected internal static string[] sMonthName = new string[] {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
protected internal static string[] sShortMonthName = new string[] {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
protected internal static string[] sShortWeekName = new string[] {"Sun", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat"};
protected internal static string[] sWeekName = new string[] {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
public static readonly int YEAR = 0;
public int hashCode()
{
return base.GetHashCode();
}
public virtual string toString(string aTimeFormat)
{
int length = aTimeFormat.Length;
int num2 = 0;
string str = "";
string str2 = "";
for (int i = 0; i < length; i++) {
if ((aTimeFormat[i] != '%') || (i == (length - 1))) {
goto Label_03BF;
}
i++;
char ch = aTimeFormat[i];
switch (ch) {
case 'H': {
num2 = SupportClass.CalendarManager.manager.Get(this, 8);
if (num2 < 10) {
str2 = str2 + "0";
}
str2 = str2 + num2.ToString();
continue;
}
case 'I': {
num2 = SupportClass.CalendarManager.manager.Get(this, 3);
if (num2 < 10) {
str2 = str2 + "0";
}
str2 = str2 + num2.ToString();
continue;
}
case 'L':
if (i == (length - 1)) {
continue;
}
i++;
ch = aTimeFormat[i];
if (ch > 'Y') {
break;
}
switch (ch) {
case 'B':
goto Label_021E;
case 'Y':
goto Label_0262;
}
goto Label_028D;
case 'M': {
num2 = SupportClass.CalendarManager.manager.Get(this, 4);
if (num2 < 10) {
str2 = str2 + "0";
}
str2 = str2 + num2.ToString();
continue;
}
case 'S': {
num2 = SupportClass.CalendarManager.manager.Get(this, 5);
if (num2 < 10) {
str2 = str2 + "0";
}
str2 = str2 + num2.ToString();
continue;
}
case 'B': {
str2 = str2 + sMonthName[SupportClass.CalendarManager.manager.Get(this, 1)];
continue;
}
case 'x': {
str2 = str2 + this.toString("%m/%d/%y");
continue;
}
case 'y': {
str = SupportClass.CalendarManager.manager.Get(this, 0).ToString();
str2 = str2 + str.Substring(2, 2);
continue;
}
case 'm': {
num2 = SupportClass.CalendarManager.manager.Get(this, 1) + 1;
if (num2 < 10) {
str2 = str2 + "0";
}
str2 = str2 + num2.ToString();
continue;
}
case 'X': {
str2 = str2 + this.toString("%H:%M:%S");
continue;
}
case 'Y': {
num2 = SupportClass.CalendarManager.manager.Get(this, 0);
str2 = str2 + num2.ToString();
continue;
}
case 'b': {
str2 = str2 + sShortMonthName[SupportClass.CalendarManager.manager.Get(this, 1)];
continue;
}
case 'c': {
str2 = str2 + this.toString("%x %X");
continue;
}
case 'd': {
num2 = SupportClass.CalendarManager.manager.Get(this, 7);
if (num2 < 10) {
str2 = str2 + "0";
}
str2 = str2 + num2.ToString();
continue;
}
default:
goto Label_03A9;
}
if (ch != 'b') {
if (ch == 'y') {
goto Label_023C;
}
goto Label_028D;
}
str2 = str2 + sLocalShortMonthName[SupportClass.CalendarManager.manager.Get(this, 1)];
continue;
Label_021E:
str2 = str2 + sLocalMonthName[SupportClass.CalendarManager.manager.Get(this, 1)];
continue;
Label_023C:
num2 = SupportClass.CalendarManager.manager.Get(this, 0) - 0x777;
str2 = str2 + num2.ToString();
continue;
Label_0262:
num2 = SupportClass.CalendarManager.manager.Get(this, 0) - 0x777;
str2 = str2 + num2.ToString() + "年";
continue;
Label_028D:
str2 = str2 + aTimeFormat[i];
continue;
Label_03A9:
str2 = str2 + aTimeFormat[i];
continue;
Label_03BF:
str2 = str2 + aTimeFormat[i];
}
return str2;
}
public override string ToString()
{
return base.ToString();
}
}
}