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.
 
 

203 lines
7.7 KiB

namespace com.hitrust.trustpay.client
{
using System;
using System.Globalization;
public class HiCalendar : GregorianCalendar
{
protected DateTime iDateTime = DateTime.Now;
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 int hashCode()
{
return base.GetHashCode();
}
public virtual string toString(string aTimeFormat)
{
int length = aTimeFormat.Length;
int hour = 0;
string str = "";
string str2 = "";
for (int i = 0; i < length; i++)
{
if ((aTimeFormat[i] != '%') || (i == (length - 1)))
{
goto Label_03BE;
}
i++;
char ch = aTimeFormat[i];
switch (ch)
{
case 'H':
{
hour = this.iDateTime.Hour;
if (hour < 10)
{
str2 = str2 + "0";
}
str2 = str2 + hour.ToString();
continue;
}
case 'I':
{
hour = this.iDateTime.Hour;
if (hour > 12)
{
hour -= 12;
}
if (hour < 10)
{
str2 = str2 + "0";
}
str2 = str2 + hour.ToString();
continue;
}
case 'L':
if (i == (length - 1))
{
continue;
}
i++;
ch = aTimeFormat[i];
if (ch > 'Y')
{
break;
}
switch (ch)
{
case 'B':
goto Label_0228;
case 'Y':
goto Label_026C;
}
goto Label_0296;
case 'M':
{
hour = this.iDateTime.Minute;
if (hour < 10)
{
str2 = str2 + "0";
}
str2 = str2 + hour.ToString();
continue;
}
case 'S':
{
hour = this.iDateTime.Second;
if (hour < 10)
{
str2 = str2 + "0";
}
str2 = str2 + hour.ToString();
continue;
}
case 'B':
{
str2 = str2 + sMonthName[this.iDateTime.Month - 1];
continue;
}
case 'x':
{
str2 = str2 + this.toString("%m/%d/%y");
continue;
}
case 'y':
{
str = this.iDateTime.Year.ToString();
str2 = str2 + str.Substring(2, 2);
continue;
}
case 'm':
{
hour = this.iDateTime.Month;
if (hour < 10)
{
str2 = str2 + "0";
}
str2 = str2 + hour.ToString();
continue;
}
case 'X':
{
str2 = str2 + this.toString("%H:%M:%S");
continue;
}
case 'Y':
{
hour = this.iDateTime.Year;
str2 = str2 + hour.ToString();
continue;
}
case 'b':
{
str2 = str2 + sShortMonthName[this.iDateTime.Month - 1];
continue;
}
case 'c':
{
str2 = str2 + this.toString("%x %X");
continue;
}
case 'd':
{
hour = this.iDateTime.Day;
if (hour < 10)
{
str2 = str2 + "0";
}
str2 = str2 + hour.ToString();
continue;
}
default:
goto Label_03A8;
}
if (ch != 'b')
{
if (ch == 'y')
{
goto Label_0247;
}
goto Label_0296;
}
str2 = str2 + sLocalShortMonthName[this.iDateTime.Month - 1];
continue;
Label_0228:
str2 = str2 + sLocalMonthName[this.iDateTime.Month - 1];
continue;
Label_0247:
hour = this.iDateTime.Year - 0x777;
str2 = str2 + hour.ToString();
continue;
Label_026C:
hour = this.iDateTime.Year - 0x777;
str2 = str2 + hour.ToString() + "年";
continue;
Label_0296:
str2 = str2 + aTimeFormat[i];
continue;
Label_03A8:
str2 = str2 + aTimeFormat[i];
continue;
Label_03BE:
str2 = str2 + aTimeFormat[i];
}
return str2;
}
public override string ToString()
{
return base.ToString();
}
}
}