common.js
//convert an Atom-formatted date string to a javascript-compatible date string
convert an Atom-formatted date string to a javascript-compatible date string
convert an Atom - formatted date string to a javascript - compatible date string
function ConvertAtomDateString(str)
{
	var atomFormat = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d*)?(Z|[+-]\d{2}:\d{2})$/i;
	if(!atomFormat.test(str)) return "";	
	var months = new Array("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	var year, month, date, hour, minute, second, offset;
	year = str.slice(0,4);
	month = months[1*str.slice(5,7)];		
	date = str.slice(8,10);		
	hour = str.slice(11,13);	
	minute = str.slice(14,16);	
	second = str.slice(17,19);	
	offset = "GMT";
	if(str.indexOf("Z") == -1)	
	{
		var x = str.lastIndexOf(":");
		offset += str.slice(x-3,x) + str.slice(x+1);
	}
	return date+" "+month+" "+year+" "+hour+":"+minute+":"+second+" "+offset;
}
function ConvertAtomDateString ( str ) { var atomFormat = / ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d*)?(Z|[+-]\d{2}:\d{2})$ / i ; if ( ! atomFormat . test ( str ) ) return "" ; var months = new Array ( "" , "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" ) ; var year , month , date , hour , minute , second , offset ; year = str . slice ( 0 , 4 ) ; month = months [ 1 * str . slice ( 5 , 7 ) ] ; date = str . slice ( 8 , 10 ) ; hour = str . slice ( 11 , 13 ) ; minute = str . slice ( 14 , 16 ) ; second = str . slice ( 17 , 19 ) ; offset = "GMT" ; if ( str . indexOf ( "Z" ) == - 1 ) { var x = str . lastIndexOf ( ":" ) ; offset += str . slice ( x - 3 , x ) + str . slice ( x + 1 ) ; } return date + " " + month + " " + year + " " + hour + ":" + minute + ":" + second + " " + offset ; }
convert an Atom-formatted date string to a javascript-compatible date string
convert an Atom - formatted date string to a javascript - compatible date string
//YYYY-MM-DDThh:mm:ss[.f*](Z|-hh:mm|+hh:mm) //invalid format //Jan-Dec //01-31 //00-23 //00-59 //00-59 //time zone offset specified //DD MMM YYYY hh:mm:ss GMT[(+|-)hhmm]