// TDC is to get DateTime format info for current locale function TDC() { var d=new Date(1970,0,0,0,0,0,0),d2=new Date(d),s1,s2,api=-1; d.setHours(10); d2.setHours(11); s1=d.toLocaleString(); s2=d2.toLocaleString(); this.displayHour=(s1!=s2); d.setHours(0); d2.setHours(0); d.setMinutes(10); d2.setMinutes(11); this.displayMinute=(d.toLocaleString()!=d2.toLocaleString()); d.setMinutes(0); d2.setMinutes(0); d.setSeconds(10); d2.setSeconds(11); this.displaySecond=(d.toLocaleString()!=d2.toLocaleString()); d.setSeconds(0); d2.setSeconds(0); if (this.displayHour) { for (i=0; i<((s1.lengths. // You can add a margin by beginning and ending your option's text with a  . var editablesHtml = ""; if (TD.displayHour) { editablesHtml += ""; } if (TD.displayMinute) { if (editablesHtml.length != 0) { editablesHtml += time_sep_span; } editablesHtml += ""; } return editablesHtml; } // get Locale Date/Time // d: input Date // return only Date part if includeDate==true, and includeTime== false // return only Time part if includeDate==false and includeTime== true // return datetime string if includeDate==true and includeTime == true function GLDT(d, includeDate, includeTime) { // Get Locale Date/Time // Returns date/and or time from locale string. // Assumes that date appears before time in string. if (includeDate && includeTime) return d.toLocaleString(); var d2 = new Date(d); var ds; var ds2; var ml; d2.setMilliseconds(d.getMilliseconds()<=887 ? d.getMilliseconds()+111 : d.getMilliseconds() - 111); d2.setSeconds(d.getSeconds()<=49 ? d.getSeconds()+11 : d.getSeconds()-11); d2.setMinutes(d.getMinutes()<=49 ? d.getMinutes()+11 : d.getMinutes()-11); // although TD.twelveHourClock could be true, but d.getHours will always get hours in 24 // only the localized the date string will be in twelve hour clock // here we want d2's hour's first digit different from d1's hour's first digit // also if d1 is morning, d2 will be in afternoon, vice versa thus we get different strings for AM, and PM // because AM/PM could be before hours (eg. in Korean) if (TD.twelveHourClock) { var hour = d.getHours(); if (hour == 0 || hour == 1 || hour == 10 || hour == 11) { d2.setHours(14); } else if (hour == 12 || hour == 13 || hour == 22 || hour == 23) { d2.setHours(2); } else if (hour < 12) { d2.setHours(13); } else { d2.setHours(1); } } else { d2.setHours( d.getHours()<12 ? (d.getHours() == 1 ? 2 : d.getHours() + 12) : (d.getHours()<20 ? 20 : 11)); } ds = d.toLocaleString(); ds2 = d2.toLocaleString(); ml = ds.length < ds2.length ? ds.length : ds2.length ; for (i=0; i