123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- // ** I18N
- // Calendar ZH language
- // Author: muziq, <muziq@sina.com>
- // Encoding: GB2312 or GBK
- // Distributed under the same terms as the calendar itself.
- // full day names
- Calendar._DN = new Array("������", "����һ", "���ڶ�", "������", "������",
- "������", "������", "������");
- // Please note that the following array of short day names (and the same goes
- // for short month names, _SMN) isn't absolutely necessary. We give it here
- // for exemplification on how one can customize the short day names, but if
- // they are simply the first N letters of the full name you can simply say:
- //
- // Calendar._SDN_len = N; // short day name length
- // Calendar._SMN_len = N; // short month name length
- //
- // If N = 3 then this is not needed either since we assume a value of 3 if not
- // present, to be compatible with translation files that were written before
- // this feature.
- // short day names
- Calendar._SDN = new Array("��", "һ", "��", "��", "��", "��", "��", "��");
- // full month names
- Calendar._MN = new Array("1��", "2��", "3��", "4��", "5��", "6��", "7��",
- "8��", "9��", "10��", "11��", "12��");
- // short month names
- Calendar._SMN = new Array("1��", "2��", "3��", "4��", "5��", "6��", "7��",
- "8��", "9��", "10��", "11��", "12��");
- // tooltips
- Calendar._TT = {};
- Calendar._TT["INFO"] = "����";
- Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n"
- + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n"
- + // don't translate this this ;-)
- "For latest version visit: http://www.dynarch.com/projects/calendar/\n"
- + "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details."
- + "\n\n" + "ѡ������:\n" + "- ��� \xab, \xbb ��ťѡ�����\n" + "- ��� "
- + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a)
- + " ��ťѡ���·�\n" + "- �������ϰ�ť�ɴӲ˵��п���ѡ����ݻ��·�";
- Calendar._TT["ABOUT_TIME"] = "\n\n" + "ѡ��ʱ��:\n" + "- ���Сʱ����ӿ�ʹ����ֵ��һ\n"
- + "- ��סShift����Сʱ����ӿ�ʹ����ֵ��һ\n" + "- ����϶����ɽ��п���ѡ��";
- Calendar._TT["PREV_YEAR"] = "��һ�� (��ס���˵�)";
- Calendar._TT["PREV_MONTH"] = "��һ�� (��ס���˵�)";
- Calendar._TT["GO_TODAY"] = "ת������";
- Calendar._TT["NEXT_MONTH"] = "��һ�� (��ס���˵�)";
- Calendar._TT["NEXT_YEAR"] = "��һ�� (��ס���˵�)";
- Calendar._TT["SEL_DATE"] = "ѡ������";
- Calendar._TT["DRAG_TO_MOVE"] = "�϶�";
- Calendar._TT["PART_TODAY"] = " (����)";
- // the following is to inform that "%s" is to be the first day of week
- // %s will be replaced with the day name.
- Calendar._TT["DAY_FIRST"] = "�������ʾ%s";
- // This may be locale-dependent. It specifies the week-end days, as an array
- // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
- // means Monday, etc.
- Calendar._TT["WEEKEND"] = "0,6";
- Calendar._TT["CLOSE"] = "�ر�";
- Calendar._TT["TODAY"] = "����";
- Calendar._TT["TIME_PART"] = "(Shift-)��������϶��ı�ֵ";
- // date formats
- Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
- Calendar._TT["TT_DATE_FORMAT"] = "%A, %b %e��";
- Calendar._TT["WK"] = "��";
- Calendar._TT["TIME"] = "ʱ��:";
- // --������ڹ����Ĺ�����չ---------------------
- /*
- * ��չ����Ҫ���ܣ� ����ũ�����ڹ�������ũ�����������������ʾ����
- * ����ڼ��յ������жϣ��ѽڼ��յ��������������ʾ������ʾ����
- * ����������ʼ����������Ч��ѡ��Ŀ���
- */
- // =====================================
- Calendar.solarTerm = new Array("С��", "��", "����", "��ˮ", "����", "����",
- "����", "����", "����", "С��", "â��", "����", "С��", "����", "����",
- "����", "��¶", "���", "��¶", "˪��", "����", "Сѩ", "��ѩ", "����")
- Calendar.lFestival = new Array("0101 ����", "0115 Ԫ���", "0505 �����",
- "0707 ��Ϧ���˽�", "0715 ��Ԫ��", "0815 �����", "0909 ������",
- "1208 ���˽�", "1224 С��", "1230 ��Ϧ")
- Calendar.sFestival = new Array("0101*Ԫ��", "0214 ���˽�", "0308 ��Ů��",
- "0312 ֲ����", "0315 �����Ȩ����", "0401 ���˽�", "0501 �Ͷ���",
- "0504 �����", "0512 ��ʿ��", "0601 ��ͯ��", "0929 ���������",
- "0701 ������ ��ۻع����", "0801 �����", "0808 ����", "0909 ëϯ��������",
- "0910 ��ʦ��", "0928 ���ӵ���", "1001*�����", "1006 ���˽�",
- "1024 ���Ϲ���", "1112 ����ɽ����", "1220 ���Żع����", "1225 ʥ����",
- "1226 ëϯ����")
- // ==============================================
- /*
- * ��������������Ͷ���Ķ��� ���ũ��, �������ڴ���ũ��������� ����������� .year .month
- * .day .isLeap .yearCyl .dayCyl .monCyl
- */
- function DateLunar(objDate) {
- var i, leap = 0, temp = 0
- var baseDate = new Date(1900, 0, 31)
- var offset = (objDate - baseDate) / 86400000;
- this.objDate = objDate;
- this.dayCyl = offset + 40
- this.monCyl = 14
- for (i = 1900; i < 2050 && offset > 0; i++) {
- temp = this.lYearDays(i);
- offset -= temp
- this.monCyl += 12
- }
- if (offset < 0) {
- offset += temp;
- i--;
- this.monCyl -= 12
- }
- this.year = i
- this.yearCyl = i - 1864
- leap = this.leapMonth(i) // ���ĸ���
- this.isLeap = false
- for (i = 1; i < 13 && offset > 0; i++) {
- // ����
- if (leap > 0 && i == (leap + 1) && this.isLeap == false) {
- --i;
- this.isLeap = true;
- temp = this.leapDays(this.year);
- } else {
- temp = this.monthDays(this.year, i);
- }
- // �������
- if (this.isLeap == true && i == (leap + 1))
- this.isLeap = false
- offset -= temp
- if (this.isLeap == false)
- this.monCyl++
- }
- if (offset == 0 && leap > 0 && i == leap + 1)
- if (this.isLeap) {
- this.isLeap = false;
- } else {
- this.isLeap = true;
- --i;
- --this.monCyl;
- }
- if (offset < 0) {
- offset += temp;
- --i;
- --this.monCyl;
- }
- this.month = i
- this.day = offset + 1
- }
- DateLunar.prototype.lunarInfo = new Array(0x04bd8, 0x04ae0, 0x0a570, 0x054d5,
- 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6,
- 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977,
- 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570,
- 0x052f2, 0x04970, 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60,
- 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0,
- 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, 0x0b550,
- 0x15355, 0x04da0, 0x0a5d0, 0x14573, 0x052d0, 0x0a9a8, 0x0e950, 0x06aa0,
- 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950,
- 0x05b57, 0x056a0, 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250,
- 0x0d558, 0x0b540, 0x0b5a0, 0x195a6, 0x095b0, 0x049b0, 0x0a974, 0x0a4b0,
- 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5, 0x04970,
- 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0,
- 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0,
- 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0,
- 0x0a5b0, 0x15176, 0x052b0, 0x0a930, 0x07954, 0x06aa0, 0x0ad50, 0x05b52,
- 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0, 0x076a3,
- 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45,
- 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255,
- 0x06d20, 0x0ada0)
- DateLunar.prototype.Animals = new Array("��", "ţ", "��", "��", "��", "��",
- "��", "��", "��", "��", "��", "��");
- DateLunar.prototype.Gan = new Array("��", "��", "��", "��", "��", "��", "��",
- "��", "��", "��");
- DateLunar.prototype.Zhi = new Array("��", "��", "��", "î", "��", "��", "��",
- "δ", "��", "��", "��", "��");
- // ==== ����ũ�� y���������
- DateLunar.prototype.lYearDays = function(y) {
- // alert("y = " + y)
- var i, sum = 348
- for (i = 0x8000; i > 0x8; i >>= 1)
- sum += (this.lunarInfo[y - 1900] & i) ? 1 : 0
- return (sum + this.leapDays(y))
- }
- // ==== ����ũ�� y�����µ�����
- DateLunar.prototype.leapDays = function(y) {
- if (this.leapMonth(y))
- return ((this.lunarInfo[y - 1900] & 0x10000) ? 30 : 29)
- else
- return (0)
- }
- // ==== ����ũ�� y�����ĸ��� 1-12 , û�� 0
- DateLunar.prototype.leapMonth = function(y) {
- return (this.lunarInfo[y - 1900] & 0xf)
- }
- // ==== ����ũ�� y��m�µ�������
- DateLunar.prototype.monthDays = function(y, m) {
- return ((this.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29)
- }
- // ==== ���� offset ���ظ�֧, 0=����
- DateLunar.prototype.cyclical = function() {
- // alert("this.objDate.getYear() = "+this.objDate.getYear() +"/n this.year =
- // " +this.year )
- // var num = this.objDate.getYear() -1900 + 36
- var num = this.year - 1900 + 36;
- return (this.Gan[num % 10] + this.Zhi[num % 12])
- }
- /** Returns the month of the day to chinese description.......... */
- DateLunar.prototype.chinaDate = function() {
- var nStr1 = new Array('��', 'һ', '��', '��', '��', '��', '��', '��', '��',
- '��', 'ʮ');
- var nStr2 = new Array('��', 'ʮ', 'إ', 'ئ', '��');
- var lunarMonth = this.month;
- var lunarday = this.day;
- var s;
- if (lunarMonth > 10) {
- s = 'ʮ' + nStr1[lunarMonth - 10]
- } else {
- s = nStr1[lunarMonth]
- }
- s += '��'
- switch (lunarday) {
- case 10 :
- s += '��ʮ';
- break;
- case 20 :
- s += '��ʮ';
- break;
- case 30 :
- s += '��ʮ';
- break;
- default :
- s += nStr2[Math.floor(lunarday / 10)];
- s += nStr1[lunarday % 10];
- }
- return (s);
- }
- DateLunar.prototype.print = function() {
- var cl = '<font color="green" STYLE="font-size:9pt;">����';
- // ũ��BB'+(cld[d].isLeap?'�� ':' ')+cld[d].lMonth+' �� '+cld[d].lDay+' ��
- var tt = this.cyclical() + '�� ' + this.chinaDate();
- return (cl + tt + '</font>');
- }
- // ----------�������ڶ���Ķ������-----------------------------
- Date.prototype.getDateLunar = function() {
- var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0,
- 0);
- return new DateLunar(d);
- };
- Date.prototype.DateLunarPrint = function() {
- var DateLunar = this.getDateLunar();
- return DateLunar.print();
- };
- Date.prototype.FestivalPrint = function() {
- var objDate = new Date(this.getFullYear(), this.getMonth(), this.getDate(),
- 0, 0, 0);
- var objDateLunar = this.getDateLunar();
- var iYear = objDate.getYear();
- var iMonth = objDate.getMonth();
- var iDate = objDate.getDate();
- var sTermInfo = new Array(0, 21208, 42467, 63836, 85337, 107014, 128867,
- 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563,
- 331033, 353350, 375494, 397447, 419210, 440795, 462224, 483532,
- 504758)
- var solarTerm = Calendar.solarTerm;
- var lDPOS = new Array(3)
- var festival = '', solarTerms = '', solarFestival = '', lunarFestival = '', tmp1, tmp2;
- for (var i = 0; i < Calendar.lFestival.length; i++) {
- if (Calendar.lFestival[i].match(/^(\d{2})(.{2})([\s\*])(.+)$/)) {
- tmp1 = Number(RegExp.$1) - objDateLunar.month
- tmp2 = Number(RegExp.$2) - objDateLunar.day
- if (tmp1 == 0 && tmp2 == 0)
- lunarFestival = RegExp.$4
- }
- }
- for (var i = 0; i < Calendar.sFestival.length; i++) {
- if (Calendar.sFestival[i].match(/^(\d{2})(\d{2})([\s\*])(.+)$/)) {
- tmp1 = Number(RegExp.$1) - (iMonth + 1)
- tmp2 = Number(RegExp.$2) - iDate
- if (tmp1 == 0 && tmp2 == 0)
- solarFestival = RegExp.$4
- }
- }
- // ����
- tmp1 = new Date((31556925974.7 * (iYear - 1900) + sTermInfo[iMonth * 2 + 1]
- * 60000)
- + Date.UTC(1900, 0, 6, 2, 5))
- tmp2 = tmp1.getUTCDate()
- if (tmp2 == iDate)
- solarTerms = solarTerm[iMonth * 2 + 1]
- tmp1 = new Date((31556925974.7 * (iYear - 1900) + sTermInfo[iMonth * 2]
- * 60000)
- + Date.UTC(1900, 0, 6, 2, 5))
- tmp2 = tmp1.getUTCDate()
- if (tmp2 == iDate)
- solarTerms = solarTerm[iMonth * 2]
- if (solarTerms == '' && solarFestival == '' && lunarFestival == '')
- festival = '';
- else
- festival = '<br><b>�����ǣ�' + solarTerms + ' ' + solarFestival + ' '
- + lunarFestival + '</b>';
- var cl = '<font color="#FF33FF" STYLE="font-size:9pt;">';
- return (cl + festival + '</font>');
- };
|