/**
 * src/core.js
 */
Date.getMonthNumberFromName=function(b){var e=Date.CultureInfo.monthNames,a=Date.CultureInfo.abbreviatedMonthNames,d=b.toLowerCase();for(var c=0;c<e.length;c++){if(e[c].toLowerCase()==d||a[c].toLowerCase()==d){return c}}return -1};Date.getDayNumberFromName=function(b){var f=Date.CultureInfo.dayNames,a=Date.CultureInfo.abbreviatedDayNames,e=Date.CultureInfo.shortestDayNames,d=b.toLowerCase();for(var c=0;c<f.length;c++){if(f[c].toLowerCase()==d||a[c].toLowerCase()==d){return c}}return -1};Date.isLeapYear=function(a){return(((a%4===0)&&(a%100!==0))||(a%400===0))};Date.getDaysInMonth=function(a,b){return[31,(Date.isLeapYear(a)?29:28),31,30,31,30,31,31,30,31,30,31][b]};Date.getTimezoneOffset=function(a,b){return(b||false)?Date.CultureInfo.abbreviatedTimeZoneDST[a.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[a.toUpperCase()]};Date.getTimezoneAbbreviation=function(b,d){var c=(d||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,a;for(a in c){if(c[a]===b){return a}}return null};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.compareTo=function(a){if(isNaN(this)){throw new Error(this)}if(a instanceof Date&&!isNaN(a)){return(this>a)?1:(this<a)?-1:0}else{throw new TypeError(a)}};Date.prototype.equals=function(a){return(this.compareTo(a)===0)};Date.prototype.between=function(c,a){var b=this.getTime();return b>=c.getTime()&&b<=a.getTime()};Date.prototype.addMilliseconds=function(a){this.setMilliseconds(this.getMilliseconds()+a);return this};Date.prototype.addSeconds=function(a){return this.addMilliseconds(a*1000)};Date.prototype.addMinutes=function(a){return this.addMilliseconds(a*60000)};Date.prototype.addHours=function(a){return this.addMilliseconds(a*3600000)};Date.prototype.addDays=function(a){return this.addMilliseconds(a*86400000)};Date.prototype.addWeeks=function(a){return this.addMilliseconds(a*604800000)};Date.prototype.addMonths=function(a){var b=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+a);this.setDate(Math.min(b,this.getDaysInMonth()));return this};Date.prototype.addYears=function(a){return this.addMonths(a*12)};Date.prototype.add=function(b){if(typeof b=="number"){this._orient=b;return this}var a=b;if(a.millisecond||a.milliseconds){this.addMilliseconds(a.millisecond||a.milliseconds)}if(a.second||a.seconds){this.addSeconds(a.second||a.seconds)}if(a.minute||a.minutes){this.addMinutes(a.minute||a.minutes)}if(a.hour||a.hours){this.addHours(a.hour||a.hours)}if(a.month||a.months){this.addMonths(a.month||a.months)}if(a.year||a.years){this.addYears(a.year||a.years)}if(a.day||a.days){this.addDays(a.day||a.days)}return this};Date._validate=function(d,c,a,b){if(typeof d!="number"){throw new TypeError(d+" is not a Number.")}else{if(d<c||d>a){throw new RangeError(d+" is not a valid value for "+b+".")}}return true};Date.validateMillisecond=function(a){return Date._validate(a,0,999,"milliseconds")};Date.validateSecond=function(a){return Date._validate(a,0,59,"seconds")};Date.validateMinute=function(a){return Date._validate(a,0,59,"minutes")};Date.validateHour=function(a){return Date._validate(a,0,23,"hours")};Date.validateDay=function(c,a,b){return Date._validate(c,1,Date.getDaysInMonth(a,b),"days")};Date.validateMonth=function(a){return Date._validate(a,0,11,"months")};Date.validateYear=function(a){return Date._validate(a,1,9999,"seconds")};Date.prototype.set=function(b){var a=b;if(!a.millisecond&&a.millisecond!==0){a.millisecond=-1}if(!a.second&&a.second!==0){a.second=-1}if(!a.minute&&a.minute!==0){a.minute=-1}if(!a.hour&&a.hour!==0){a.hour=-1}if(!a.day&&a.day!==0){a.day=-1}if(!a.month&&a.month!==0){a.month=-1}if(!a.year&&a.year!==0){a.year=-1}if(a.millisecond!=-1&&Date.validateMillisecond(a.millisecond)){this.addMilliseconds(a.millisecond-this.getMilliseconds())}if(a.second!=-1&&Date.validateSecond(a.second)){this.addSeconds(a.second-this.getSeconds())}if(a.minute!=-1&&Date.validateMinute(a.minute)){this.addMinutes(a.minute-this.getMinutes())}if(a.hour!=-1&&Date.validateHour(a.hour)){this.addHours(a.hour-this.getHours())}if(a.month!==-1&&Date.validateMonth(a.month)){this.addMonths(a.month-this.getMonth())}if(a.year!=-1&&Date.validateYear(a.year)){this.addYears(a.year-this.getFullYear())}if(a.day!=-1&&Date.validateDay(a.day,this.getFullYear(),this.getMonth())){this.addDays(a.day-this.getDate())}if(a.timezone){this.setTimezone(a.timezone)}if(a.timezoneOffset){this.setTimezoneOffset(a.timezoneOffset)}return this};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};Date.prototype.isLeapYear=function(){var a=this.getFullYear();return(((a%4===0)&&(a%100!==0))||(a%400===0))};Date.prototype.isWeekday=function(){return !(this.is().sat()||this.is().sun())};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1})};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()})};Date.prototype.moveToDayOfWeek=function(a,b){var c=(a-this.getDay()+7*(b||+1))%7;return this.addDays((c===0)?c+=7*(b||+1):c)};Date.prototype.moveToMonth=function(c,a){var b=(c-this.getMonth()+12*(a||+1))%12;return this.addMonths((b===0)?b+=12*(a||+1):b)};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000)};Date.prototype.getWeekOfYear=function(a){var h=this.getFullYear(),c=this.getMonth(),f=this.getDate();var j=a||Date.CultureInfo.firstDayOfWeek;var e=7+1-new Date(h,0,1).getDay();if(e==8){e=1}var b=((Date.UTC(h,c,f,0,0,0)-Date.UTC(h,0,1,0,0,0))/86400000)+1;var i=Math.floor((b-e+7)/7);if(i===j){h--;var g=7+1-new Date(h,0,1).getDay();if(g==2||g==8){i=53}else{i=52}}return i};Date.prototype.isDST=function(){console.log("isDST");return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D"};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST())};Date.prototype.setTimezoneOffset=function(b){var a=this.getTimezoneOffset(),c=Number(b)*-6/10;this.addMinutes(c-a);return this};Date.prototype.setTimezone=function(a){return this.setTimezoneOffset(Date.getTimezoneOffset(a))};Date.prototype.getUTCOffset=function(){var b=this.getTimezoneOffset()*-10/6,a;if(b<0){a=(b-10000).toString();return a[0]+a.substr(2)}else{a=(b+10000).toString();return"+"+a.substr(1)}};Date.prototype.getDayName=function(a){return a?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()]};Date.prototype.getMonthName=function(a){return a?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()]};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(c){var a=this;var b=function b(f){return(f.toString().length==1)?"0"+f:f};var e=function d(f){f=""+f;var g="000";return g.substring(0,4-f.length)+f};return c?c.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(f){switch(f){case"hh":return b(a.getHours()<13?a.getHours():(a.getHours()-12));case"h":return a.getHours()<13?a.getHours():(a.getHours()-12);case"HH":return b(a.getHours());case"H":return a.getHours();case"mm":return b(a.getMinutes());case"m":return a.getMinutes();case"ss":return b(a.getSeconds());case"s":return a.getSeconds();case"yyyy":return e(a.getFullYear());case"yy":return e(a.getFullYear()).substring(2,4);case"dddd":return a.getDayName();case"ddd":return a.getDayName(true);case"dd":return b(a.getDate());case"d":return a.getDate().toString();case"MMMM":return a.getMonthName();case"MMM":return a.getMonthName(true);case"MM":return b((a.getMonth()+1));case"M":return a.getMonth()+1;case"t":return a.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return a.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return""}}):this._toString()};
/**
 * src/globalization/en-US.js
 */
Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};
/**
 * src/parser.js
 */
(function(){Date.Parsing={Exception:function(i){this.message="Parse error at '"+i.substring(0,10)+" ...'"}};var a=Date.Parsing;a.Metadata=function(){this._matches={};this._parsed=null;this._order=[]};a.Metadata.prototype={FIELDS:["hour","minute","second","meridian","timezone","day","month","year","rday","milliseconds"],addParsedValues:function(k){if(this._parsed){return}this._parsed={};for(var i=0;i<this.FIELDS.length;i++){var j=this.FIELDS[i];this._parsed[j]=k[j]}},explicit:function(k){var j=this._parsed[k];var i=this._matches[k];return !i?false:j==undefined?false:typeof j=="number"?j>=0:!!j},match:function(i){if(!this.explicit(i)){return null}return this._matches[i]},addMatch:function(j,i){this._matches[j]=i;this._order.push(j)},relativeDay:function(){return !!this._matches.rday},getOrder:function(){return this._order}};var c=a.Operators={rtoken:function(i){return function(j){var k=j.match(i);if(k){return([k[0],j.substring(k[0].length)])}else{throw new a.Exception(j)}}},token:function(i){return function(j){return c.rtoken(new RegExp("^s*"+j+"s*"))(j)}},stoken:function(i){return c.rtoken(new RegExp("^"+i))},until:function(i){return function(j){var k=[],m=null;while(j.length){try{m=i.call(this,j)}catch(l){k.push(m[0]);j=m[1];continue}break}return[k,j]}},many:function(i){return function(j){var m=[],k=null;while(j.length){try{k=i.call(this,j)}catch(l){return[m,j]}m.push(k[0]);j=k[1]}return[m,j]}},optional:function(i){return function(j){var k=null;try{k=i.call(this,j)}catch(l){return[null,j]}return[k[0],k[1]]}},not:function(i){return function(j){try{i.call(this,j)}catch(k){return[null,j]}throw new a.Exception(j)}},ignore:function(i){return i?function(j){var k=null;k=i.call(this,j);return[null,k[1]]}:null},product:function(){var k=arguments[0],l=Array.prototype.slice.call(arguments,1),m=[];for(var j=0;j<k.length;j++){m.push(c.each(k[j],l))}return m},cache:function(k){var i={},j=null;return function(l){try{j=i[l]=(i[l]||k.call(this,l))}catch(m){j=i[l]=m}if(j instanceof a.Exception){throw j}else{return j}}},any:function(){var i=arguments;return function(k){var l=null;for(var j=0;j<i.length;j++){if(i[j]==null){continue}try{l=(i[j].call(this,k))}catch(m){l=null}if(l){return l}}throw new a.Exception(k)}},each:function(){var i=arguments;return function(k){var n=[],l=null;for(var j=0;j<i.length;j++){if(i[j]==null){continue}try{l=(i[j].call(this,k))}catch(m){throw new a.Exception(k)}n.push(l[0]);k=l[1]}return[n,k]}},all:function(){var j=arguments,i=i;return i.each(i.optional(j))},sequence:function(i,j,k){j=j||c.rtoken(/^\s*/);k=k||null;if(i.length==1){return i[0]}return function(o){var p=null,t=null;var v=[];for(var n=0;n<i.length;n++){try{p=i[n].call(this,o)}catch(u){break}v.push(p[0]);try{t=j.call(this,p[1])}catch(m){t=null;break}o=t[1]}if(!p){throw new a.Exception(o)}if(t){throw new a.Exception(t[1])}if(k){try{p=k.call(this,p[1])}catch(l){throw new a.Exception(p[1])}}return[v,(p?p[1]:o)]}},between:function(j,k,i){i=i||j;var l=c.each(c.ignore(j),k,c.ignore(i));return function(m){var n=l.call(this,m);return[[n[0][0],r[0][2]],n[1]]}},list:function(i,j,k){j=j||c.rtoken(/^\s*/);k=k||null;return(i instanceof Array?c.each(c.product(i.slice(0,-1),c.ignore(j)),i.slice(-1),c.ignore(k)):c.each(c.many(c.each(i,c.ignore(j))),px,c.ignore(k)))},set:function(i,j,k){j=j||c.rtoken(/^\s*/);k=k||null;return function(B){var l=null,n=null,m=null,o=null,t=[[],B],A=false;for(var v=0;v<i.length;v++){m=null;n=null;l=null;A=(i.length==1);try{l=i[v].call(this,B)}catch(y){continue}o=[[l[0]],l[1]];if(l[1].length>0&&!A){try{m=j.call(this,l[1])}catch(z){A=true}}else{A=true}if(!A&&m[1].length===0){A=true}if(!A){var w=[];for(var u=0;u<i.length;u++){if(v!=u){w.push(i[u])}}n=c.set(w,j).call(this,m[1]);if(n[0].length>0){o[0]=o[0].concat(n[0]);o[1]=n[1]}}if(o[1].length<t[1].length){t=o}if(t[1].length===0){break}}if(t[0].length===0){return t}if(k){try{m=k.call(this,t[1])}catch(x){throw new a.Exception(t[1])}t[1]=m[1]}return t}},forward:function(i,j){return function(k){return i[j].call(this,k)}},replace:function(j,i){return function(k){var l=j.call(this,k);return[i,l[1]]}},process:function(j,i){return function(k){var l=j.call(this,k);return[i.call(this,l[0]),l[1]]}},min:function(i,j){return function(k){var l=j.call(this,k);if(l[0].length<i){throw new a.Exception(k)}return l}}};var h=function(i){return function(){var j=null,m=[];if(arguments.length>1){j=Array.prototype.slice.call(arguments)}else{if(arguments[0] instanceof Array){j=arguments[0]}}if(j){for(var l=0,k=j.shift();l<k.length;l++){j.unshift(k[l]);m.push(i.apply(null,j));j.shift();return m}}else{return i.apply(null,arguments)}}};var g="optional not ignore cache".split(/\s/);for(var d=0;d<g.length;d++){c[g[d]]=h(c[g[d]])}var f=function(i){return function(){if(arguments[0] instanceof Array){return i.apply(null,arguments[0])}else{return i.apply(null,arguments)}}};var e="each any all".split(/\s/);for(var b=0;b<e.length;b++){c[e[b]]=f(c[e[b]])}}());(function(){var e=Date,l=e.prototype,f=e.CultureInfo;var h=function(m){var n=[];for(var g=0;g<m.length;g++){if(m[g] instanceof Array){n=n.concat(h(m[g]))}else{if(m[g]){n.push(m[g])}}}return n};e.Grammar={};e.Translator={hour:function(g){return function(){this.parseMetadata.addMatch("hour",g);this.hour=Number(g)}},minute:function(g){return function(){this.parseMetadata.addMatch("minute",g);this.minute=Number(g)}},second:function(g){return function(){this.parseMetadata.addMatch("second",g);this.second=Number(g)}},meridian:function(g){return function(){this.parseMetadata.addMatch("meridian",g);this.meridian=g.slice(0,1).toLowerCase()}},timezone:function(g){return function(){this.parseMetadata.addMatch("timezone",g);var m=g.replace(/[^\d\+\-]/g,"");if(m.length){this.timezoneOffset=Number(m)}else{this.timezone=g.toLowerCase()}}},day:function(g){var m=g[0];return function(){this.parseMetadata.addMatch("day",m);this.day=Number(m.match(/\d+/)[0])}},month:function(g){return function(){this.parseMetadata.addMatch("month",g);this.month=((g.length==3)?e.getMonthNumberFromName(g):(Number(g)-1))}},year:function(g){return function(){this.parseMetadata.addMatch("year",g);var m=Number(g);this.year=((g.length>2)?m:(m+(((m+2000)<f.twoDigitYearMax)?2000:1900)))}},rday:function(g){return function(){this.parseMetadata.addMatch("rday",g);switch(g){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break}}},finishExact:function(g){g=(g instanceof Array)?g:[g];for(var n=0;n<g.length;n++){if(g[n]){g[n].call(this)}}var m=new Date();if((this.hour||this.minute)&&(!this.month&&!this.year&&!this.day)){this.day=m.getDate()}if(!this.year){this.year=m.getFullYear()}if(!this.month&&this.month!==0){this.month=m.getMonth()}if(!this.day){this.day=1}if(!this.hour){this.hour=0}if(!this.minute){this.minute=0}if(!this.second){this.second=0}this.parseMetadata.addParsedValues(this);if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12}else{if(this.meridian=="a"&&this.hour==12){this.hour=0}}}if(this.day>e.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.")}var o=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){o.set({timezone:this.timezone})}else{if(this.timezoneOffset){o.set({timezoneOffset:this.timezoneOffset})}}o.parseMetadata=this.parseMetadata;return o},finish:function(s){s=(s instanceof Array)?h(s):[s];if(s.length===0){return null}for(var m=0;m<s.length;m++){if(typeof s[m]=="function"){s[m].call(this)}}this.parseMetadata.addParsedValues(this);var o=e.today();if(this.now&&!this.unit&&!this.operator){return new Date()}else{if(this.now){o=new Date()}}var n=!!(this.days&&this.days!==null||this.orient||this.operator);var q,p,g;g=((this.orient=="past"||this.operator=="subtract")?-1:1);if(!this.now&&"hour minute second".indexOf(this.unit)!=-1){o.setTimeToNow()}if(this.month||this.month===0){if("year day hour minute second".indexOf(this.unit)!=-1){this.value=this.month+1;this.month=null;n=true}}if(!n&&this.weekday&&!this.day&&!this.days){var t=Date[this.weekday]();this.day=t.getDate();if(!this.month){this.month=t.getMonth()}this.year=t.getFullYear()}if(n&&this.weekday&&this.unit!="month"){this.unit="day";q=(e.getDayNumberFromName(this.weekday)-o.getDay());p=7;this.days=q?((q+(g*p))%p):(g*p)}if(this.month&&this.unit=="day"&&this.operator){this.value=(this.month+1);this.month=null}if(this.value!=null&&this.month!=null&&this.year!=null){this.parseMetadata.addMatch("day",this.value+"");this.parseMetadata._parsed.day=this.value;this.day=this.value*1}if(this.month&&!this.day&&this.value){o.set({day:this.value*1});if(!n){this.day=this.value*1}}if(!this.month&&this.value&&this.unit=="month"&&!this.now){this.month=this.value;n=true}if(n&&(this.month||this.month===0)&&this.unit!="year"){this.unit="month";q=(this.month-o.getMonth());p=12;this.months=q?((q+(g*p))%p):(g*p);this.month=null}if(!this.unit){this.unit="day"}if(!this.value&&this.operator&&this.operator!==null&&this[this.unit+"s"]&&this[this.unit+"s"]!==null){this[this.unit+"s"]=this[this.unit+"s"]+((this.operator=="add")?1:-1)+(this.value||0)*g}else{if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1}this[this.unit+"s"]=this.value*g}}if(this.meridian&&this.hour){if(this.meridian=="p"&&this.hour<12){this.hour=this.hour+12}else{if(this.meridian=="a"&&this.hour==12){this.hour=0}}}if(this.weekday&&!this.day&&!this.days){var t=Date[this.weekday]();this.day=t.getDate();if(t.getMonth()!==o.getMonth()){this.month=t.getMonth()}}if(this.month&&!this.day){this.day=1}if(!this.orient&&!this.operator&&this.unit=="week"&&this.value&&!this.day&&!this.month){return e.jan().first().mon().addWeeks(this.value)}if(n&&this.timezone&&this.day&&this.days){this.day=this.days}var u=(n)?o.add(this):o.set(this);u.parseMetadata=this.parseMetadata;return u}};var i=e.Parsing.Operators,d=e.Grammar,k=e.Translator,b;d.datePartDelimiter=i.rtoken(/^([\s\-\.\,\/\x27]+)/);d.timePartDelimiter=i.stoken("[:h.]");d.whiteSpace=i.rtoken(/^\s*/);d.generalDelimiter=i.rtoken(/^(([\s\,]|at|@|on)+)/);var a={};d.ctoken=function(p){var o=a[p];if(!o){var q=f.regexPatterns;var n=p.split(/\s+/),m=[];for(var g=0;g<n.length;g++){m.push(i.replace(i.rtoken(q[n[g]]),n[g]))}o=a[p]=i.any.apply(null,m)}return o};d.ctoken2=function(g){return i.rtoken(f.regexPatterns[g])};d.h=i.cache(i.process(i.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),k.hour));d.hh=i.cache(i.process(i.rtoken(/^(0[0-9]|1[0-2])/),k.hour));d.H=i.cache(i.process(i.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),k.hour));d.HH=i.cache(i.process(i.rtoken(/^([0-1][0-9]|2[0-3])/),k.hour));d.m=i.cache(i.process(i.rtoken(/^([0-5][0-9]|[0-9])/),k.minute));d.mm=i.cache(i.process(i.rtoken(/^[0-5][0-9]/),k.minute));d.s=i.cache(i.process(i.rtoken(/^([0-5][0-9]|[0-9])/),k.second));d.ss=i.cache(i.process(i.rtoken(/^[0-5][0-9]/),k.second));d.hms=i.cache(i.sequence([d.H,d.mm,d.ss],d.timePartDelimiter));d.t=i.cache(i.process(d.ctoken2("shortMeridian"),k.meridian));d.tt=i.cache(i.process(d.ctoken2("longMeridian"),k.meridian));d.z=i.cache(i.process(i.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),k.timezone));d.zz=i.cache(i.process(i.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),k.timezone));d.zzz=i.cache(i.process(d.ctoken2("timezone"),k.timezone));d.timeSuffix=i.each(i.ignore(d.whiteSpace),i.set([d.tt,d.zzz]));d.time=i.each(i.optional(i.ignore(i.stoken("T"))),d.hms,d.timeSuffix);d.d=i.cache(i.process(i.each(i.rtoken(/^([0-2]\d|3[0-1]|\d)/),i.optional(d.ctoken2("ordinalSuffix"))),k.day));d.dd=i.cache(i.process(i.each(i.rtoken(/^([0-2]\d|3[0-1])/),i.optional(d.ctoken2("ordinalSuffix"))),k.day));d.ddd=d.dddd=i.cache(i.process(d.ctoken("sun mon tue wed thu fri sat"),function(g){return function(){this.weekday=g}}));d.M=i.cache(i.process(i.rtoken(/^(1[0-2]|0\d|\d)/),k.month));d.MM=i.cache(i.process(i.rtoken(/^(1[0-2]|0\d)/),k.month));d.MMM=d.MMMM=i.cache(i.process(d.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),k.month));d.y=i.cache(i.process(i.rtoken(/^(\d\d?)/),k.year));d.yy=i.cache(i.process(i.rtoken(/^(\d\d)/),k.year));d.yyy=i.cache(i.process(i.rtoken(/^(\d\d?\d?\d?)/),k.year));d.yyyy=i.cache(i.process(i.rtoken(/^(\d\d\d\d)/),k.year));b=function(){return i.each(i.any.apply(null,arguments),i.not(d.ctoken2("timeContext")))};d.day=b(d.d,d.dd);d.month=b(d.M,d.MMM);d.year=b(d.yyyy,d.yy);d.orientation=i.process(d.ctoken("past future"),function(g){return function(){this.orient=g}});d.operator=i.process(d.ctoken("add subtract"),function(g){return function(){this.operator=g}});d.rday=i.process(d.ctoken("yesterday tomorrow today now"),k.rday);d.unit=i.process(d.ctoken("second minute hour day week month year"),function(g){return function(){this.unit=g}});d.value=i.process(i.rtoken(/^\d\d?(st|nd|rd|th)?/),function(g){return function(){this.value=g.replace(/\D/g,"")}});d.expression=i.set([d.rday,d.operator,d.value,d.unit,d.orientation,d.ddd,d.MMM]);b=function(){return i.set(arguments,d.datePartDelimiter)};d.mdy=b(d.ddd,d.month,d.day,d.year);d.ymd=b(d.ddd,d.year,d.month,d.day);d.dmy=b(d.ddd,d.day,d.month,d.year);d.date=function(g){return((d[f.dateElementOrder]||d.mdy).call(this,g))};d.format=i.process(i.many(i.any(i.process(i.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(g){if(d[g]){return d[g]}else{throw e.Parsing.Exception(g)}}),i.process(i.rtoken(/^[^dMyhHmstz]+/),function(g){return i.ignore(i.stoken(g))}))),function(g){return i.process(i.each.apply(null,g),k.finishExact)});var j={};var c=function(g){return j[g]=(j[g]||d.format(g)[0])};d.formats=function(m){if(m instanceof Array){var n=[];for(var g=0;g<m.length;g++){n.push(c(m[g]))}return i.any.apply(null,n)}else{return c(m)}};d._formats=d.formats(['"yyyy-MM-ddTHH:mm:ssZ"',"yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]);d._start=i.process(i.set([d.date,d.time,d.expression],d.generalDelimiter,d.whiteSpace),k.finish);d.start=function(g){startObject=function(){return{parseMetadata:new Date.Parsing.Metadata()}};try{var m=d._formats.call(startObject(),g);if(m[1].length===0){return m}}catch(n){}return d._start.call(startObject(),g)};e._parse=e.parse;e.parse=function(g){var m=null;if(!g){return null}if(g instanceof Date){return g}try{m=e.Grammar.start.call({},g.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1"))}catch(n){return null}return((m[1].length===0)?m[0]:null)};e.getParseFunction=function(m){var g=e.Grammar.formats(m);return function(n){var o=null;try{o=g.call({},n)}catch(p){return null}return((o[1].length===0)?o[0]:null)}};e.parseExact=function(g,m){return e.getParseFunction(m)(g)}}());
/**
 * src/sugarpak.js
 */
Date.now=function(){return new Date()};Date.today=function(){return Date.now().clearTime()};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var a={};a[this._dateElement]=this;return Date.now().add(a)};Number.prototype.ago=function(){var a={};a[this._dateElement]=this*-1;return Date.now().add(a)};(function(){var g=Date.prototype,a=Number.prototype;var p=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),o=("january february march april may june july august september october november december").split(/\s/),n=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),m;var l=function(i){return function(){if(this._is){this._is=false;return this.getDay()==i}return this.moveToDayOfWeek(i,this._orient)}};for(var f=0;f<p.length;f++){g[p[f]]=g[p[f].substring(0,3)]=l(f)}var h=function(i){return function(){if(this._is){this._is=false;return this.getMonth()===i}return this.moveToMonth(i,this._orient)}};for(var d=0;d<o.length;d++){g[o[d]]=g[o[d].substring(0,3)]=h(d)}var e=function(i){return function(){if(i.substring(i.length-1)!="s"){i+="s"}return this["add"+i](this._orient)}};var b=function(i){return function(){this._dateElement=i;return this}};for(var c=0;c<n.length;c++){m=n[c].toLowerCase();g[m]=g[m+"s"]=e(n[c]);a[m]=a[m+"s"]=b(m)}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ")};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern)};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern)};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern)};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern)};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};
/**
 * date_js
 */
(function($){

    // matches two digit years when no date is specified
    // eg.: 2/30
    var TWO_DIGIT_YEAR = /^([a-z]{3}|\d{1,2})\s*\/?\s*(\d{2})\s*$/;

    // matches years with AD or CE
    // eg.: 1400 AD, 1400 a.D., 1400 CE, 1400 C.e.
    var AD_YEAR = /(\d{1,4})\s*((a\.?d\.?)|(c\.?e\.?))/ ;

    var BC_YEAR = /(\d{1,4})\s*(bce|bc|b.c.e.|b.c.)/;
     
    // matches strings that are just years that have 2 or 3 leading zeros
    var YEAR_LEADING_ZEROES = /^0{2,3}\d{1,2}$/ ;

    var _parse = Date.parse;
    //Account for some weaknesses of datejs library.
    //
    // * DateJs will match 2/28 as "February 28th" and 2/99 as "February 1999"
    //   but oddly, it will not recognize 2/30 or 2/31 as "February 2030" 
    //   (or 1930) so we try to catch those cases here by explicitly adding "20"
    //   to the begining of the year, but then marking the parseMetadata as 
    //   having been passed "30" so that the ambiguity rules will still catch 
    //   the year ambiguiity
    Date.parse = function(s){
        if (s.match(YEAR_LEADING_ZEROES)){
            s = s + "AD";
        }
      
        var d = _parse.call(Date,s);

        s = s.toLowerCase();
        if (!d){
            var origd2 = null;
            s = s.replace(TWO_DIGIT_YEAR, function(orig, d1,d2){
                origd2 = d2;
                return d1 + "/" + "20" + d2;
            });
            
            if (origd2){
                d = _parse.call(Date, s);
                if (d){
                    d.parseMetadata._matches.year = origd2;
                }
            } else {
                var year  = null;
                s = s.replace(AD_YEAR, function(orig, d1){
                    year = d1;
                    var s  = "000" + year;
                    return s.substring(s.length - 4, s.length);
                });
                if (year){                    
                    d = _parse.call(Date,s);
                    if (d) {
                        var year = parseInt(year,10);
                        d.setFullYear(year);
                    }
                }
            }
        }
        
        if (d && d.parseMetadata){
            var pmd = d.parseMetadata;
            // if there is a time component...
            if (pmd.explicit("hour")){
                // ... make sure that either ALL the date components are 
                // specified, or none of them. 
                return (( (pmd.explicit("month")
                          + pmd.explicit("day")
                          + pmd.explicit("year")) % 3) == 0) 
                    && d;
            }
        }

        return d;
    };

    Date.prototype.toISOString = function(format){
        var bc = this.getFullYear() < 0;
        var date = null;
        if (bc) {
            date = this.clone();
            date.setFullYear(date.getFullYear() * -1);
        } else {
            date = this;
        }
        if (!format) {
            format = $.datejs._isoFormat;
        }
        var result = date.toString(format);
        if (bc){
            result = "-" + result;
        }
        return result;
    };
    
    $.datejs = {
        
                
        /**
         * Parses the given date, and returns an object with the following 
         * properties:
         *     date:       the JavaScript date object, if the parse was successful;
         *                 otherwise null
         *     choices:    if the string was ambiguous, this is an array of 
         *                 strings representing the different possible dates that 
         *                 the given string could mean
         *     iso:        the date as a string, formatted as needed to store in
         *                 the graph
         *     formatted: the date as a string to be displayed to end users
         *              
         */
        parse: function(s){
            
            var bc = BC_YEAR.test(s.toLowerCase());
            if (bc) {
                // If there is a bc year then get rid of the bc suffix
                s = s.toLowerCase().replace(BC_YEAR, 
                    function(orig, year, bc_part){
                        var s  = "000" + year;
                        return s.substring(s.length - 4, s.length);
                });
            }
            
            if (s == "now"){
                return {
                    date:null,
                    choices:null,
                    formatted:this._formatDate(new Date(), this._humanDateFormats[0], this._humanTimeFormats[0]),
                    iso:"__now__"
                };
            }
            
            var date = Date.parse(s);
            if (bc) {
                // If this is a bc year then the year should be negative
                // and one closer to 0 to conform to the iso standard.
                date.setFullYear(-date.getFullYear() + 1);
            }
            
            var choices = null;
            var formatted = null;
            var iso = null;
            if (date) {
                choices = this.getChoices(date);
                formatted = this.getFormattedString(date);
                iso = this.getIsoString(date);
            }
            return {
                date:choices ? null : date,
                choices:choices,
                formatted:choices ? null : formatted,
                iso: choices ? null : iso
            };
        },
        
        getChoices: function(date){
            //convert the date to a data object for processing
            var data = $.datejs._dateData(date);
            
            var _getChoices = function(data){
                var choices = [];
                for (var x = 0; x < $.datejs._tests.length; x++){
                    var test = $.datejs._tests[x];
                    var newChoices = $.datejs._runTest(test, data);
                    if (newChoices != null){
                        for (var y = 0; y < newChoices.length; y++){
                            choices = choices.concat(_getChoices(newChoices[y]));
                        }
                        return choices;
                    }
                }
                return [data];
            };

            var choices = _getChoices(data);

            //format as strings, removing dupes
            var set = {};
            var deDuped = [];
            for (var x = 0; x < choices.length; x++){
                var formatted = $.datejs.getFormattedString($.datejs._dataToDate(choices[x]));
                if (!set[formatted]){
                    deDuped.push(formatted);
                    set[formatted] = true;
                }
            }

            return deDuped.length > 1 ? deDuped : null;
        },
        
        getFormattedString: function(date) {
            var fieldIndex = this._getMostSpecificField(date);
            var hasDateComponent = this._hasDateComponent(date);

            var dateFormat = null;
            var timeFormat = null;

            // if there is no time component...
            if (fieldIndex >= 3){
                dateFormat = this._humanDateFormats[fieldIndex - 3];
            } else {
                if (hasDateComponent){
                    dateFormat = this._humanDateFormats[0];
                }
                timeFormat = this._humanTimeFormats[fieldIndex];
            }
            
            return this._formatDate(date, dateFormat, timeFormat);
        }, 
        
        _formatDate: function(date, dateFormat, timeFormat){
            var result = "";
            if (dateFormat){
                if (date.getFullYear() <= 0) {
                    date = date.clone();
                    date.setFullYear(-date.getFullYear() + 1);
                    dateFormat = dateFormat.replace("yyyy", "yyyy B.C.E.");
                } else if (date.getFullYear() > 0 && date.getFullYear() < 1000){
                    //display C.E. for years that are less than 1000
                    dateFormat = dateFormat.replace("yyyy", "yyyy C.E.");
                }
                
                result = date.toString(dateFormat);
                
                // there is no format string to pass to DateJS to make it print a
                // raw year with arbitrary digits and no leading zeroes, so we have to 
                // get rid of the leading zeroes ourselves.
                result = result.replace(/(\d{4}) (C\.E\.|B\.C\.E\.)/, function(orig, c1, c2){
                    return parseInt(c1, 10) + " " + c2;
                });
            }
            
            if (timeFormat){
                result += (result ? " " : "") 
                    + date.toString(timeFormat).replace(/(AM)|(PM)/, function(s){
                                                            return s.toLowerCase();
                                                        });
            }
            
            return result;
        },
        
        getIsoString: function(date){
            var fieldIndex = this._getMostSpecificField(date);
            var hasDateComponent = this._hasDateComponent(date);
            
            //this works because every field (except year) is two digits plus a x
            //seperator, so we can just chop off the amount of fields not 
            //specified * 3 from the formatstring
            return date.toISOString(this._isoFormat.substring(hasDateComponent ? 0 : 11, this._isoFormat.length - fieldIndex*3));
        },
        
        _getMostSpecificField: function(date){
            if (date.parseMetadata.relativeDay()){
                return 3;
            }
            var x;
            var metadata = date.parseMetadata;
            for (x = 0; x < this._fields.length; x++){
                if (metadata.explicit(this._fields[x][0])){
                    break;
                }
            }
            return x;
        },
        
        _hasDateComponent: function(date){
            if (date.parseMetadata.relativeDay()){
                return true;
            }
            
            var pmd = date.parseMetadata;
            return pmd.explicit("year") 
                || pmd.explicit("month")
                || pmd.explicit("day");
        },

        _swapOrder: function(data, field1, field2){
            var order = data.order;
            var i1, i2 = -1;
            for (var x = 0; x < order.length; x++){
                if (order[x] == field1){
                    i1 = x; 
                } else if (order[x] == field2){
                    i2 = x;
                }
                if (i1 > -1 && i2 > -1){
                    order[i1] = field2;
                    order[i2] = field1;
                    return;
                }
            }
        },

        /**
         * These are the rules for determining ambiguity. Each rule takes a date 
         * data object (created by _dateData) as an argument. 
         * 
         * If a rule finds a date to be ambiguous, it will return a list of new
         * date data objects representing the possibilities that the amibiguity allows.
         * 
         * Each possibility returned must "fix" one field as being unambiguous, 
         * thus ensuring that when this date gets passed through the rules engine
         * the same ambiguity is not noted.
         *
         * If the input is unambiguous for a given rule, null is returned.
         */
        _tests:[

            //month and day are <= 12 --> month,day options for each other
            {   
                name: "dateMonthAmbiguity",
                fields: ["month", "day"],
                test: function(date){
                    if (!$.datejs._isNumeric(date.match["month"])){
                        return null;
                    }

                    //yup, 11, because months start at zero internally.
                    if ( (date.fields.month <= 11) && (date.fields.day <=12) 
                         && (date.order[0] != "year") ){

                        if (date.fields.month +1 == date.fields.day){
                            return null;
                        }

                        var choice1 = $.datejs._cloneDateData(date);
                        choice1.definite.month = true;
                        
                        var choice2 = $.datejs._cloneDateData(choice1);
                        choice2.fields.month = choice1.fields.day - 1;
                        choice2.match.month = choice1.match.day;

                        choice2.fields.day = choice1.fields.month + 1;
                        choice2.match.day = choice1.match.month;
                        $.datejs._swapOrder(choice2, "day", "month");
                        
                        var choice3 = $.datejs._cloneDateData(choice1);
                        var choice4 = $.datejs._cloneDateData(choice2);
                        $([choice3, choice4]).each(function(i, choice){
                            choice.definite.month = false;
                            choice.definite.day = true;
                        });
                        return [choice1, choice2, choice3, choice4];
                    }
                    return null;
                }
            },

            //year two digits --> year can be 19XX or 20XX
            {
                name: "twoDigitYear",
                fields: ["year"],
                test: function(date){
                    if (date.match.year.length == 2){
                        var choice1 = $.datejs._cloneDateData(date);
                        choice1.definite.year = true;
                        choice1.fields.year = parseInt("20" + date.match.year);
                        var choice2 = $.datejs._cloneDateData(choice1);
                        choice2.fields.year = parseInt("19" + date.match.year);
                        return[choice1, choice2];
                    }
                    return null;
                }
            },

            //year not explicit, day field <= 31 --> day field could be day or year
            {
                name: "dayOrYear",
                fields:["day"],
                test: function(date){
                    if (!date.explicit.year && date.fields.day <= 31 
                        && date.match.day.length == 2
                        && !date.definite.year 
                        && date.order[1] == "day"){
                        var choices = [$.datejs._cloneDateData(date)];

                        choices[0].fields.year = (new Date()).getFullYear();
                        choices[0].definite.year = true;
                        choices[0].definite.day = true;

                        choices[1] = $.datejs._cloneDateData(date);
                        choices[1].fields.year = parseInt("20" +  date.match.day);
                        choices[1].match.year = date.fields.day;
                        choices[1].explicit.year = true;
                        $.datejs._swapOrder(choices[1], "year", "day");

                        choices[1].fields.day = null;
                        choices[1].match.day = null;
                        choices[1].explicit.day = false;           
                        choices[1].definite.day = true;

                        choices[2] = $.datejs._cloneDateData(choices[1]);
                        choices[2].fields.year = parseInt("19" + date.match.day);
                        choices[2].match.year = date.fields.day;

                        return choices;
                        
                    }
                    return null;
                }
                
            }
      
        ],

        _runTest: function(test, date){
            // make sure that the ambiguous fields are present and that none are
            // definitively determined yet
            for (var x = 0; x < test.fields.length; x++){
                var field = test.fields[x];
                if (date.definite[field]){
                    return null;
                }

                if (!date.explicit[field]){
                    return null;
                }
            }
            
            var choices = test.test(date);
            if (!choices){
                return null;
            }
            var verified = [];
            
            for (var x = 0; x < choices.length; x++){
                if ($.datejs._dataToDate(choices[x])){
                    verified.push(choices[x]);
                }
            }

            return verified;
        },

        _dataToDate: function(data){
            var f = data.fields;
            var d = new Date(2000,0,1);
            for (var x = 0; x < $.datejs._fields.length; x++){
                field = $.datejs._fields[x];
                if (f[field[0]] != null){
                    d["set" + field[1]](f[field[0]]);
                }
            }
            d.setMilliseconds(0);
            for (var x = 0; x < $.datejs._fields.length; x++){
                field = $.datejs._fields[x];
                // this verifies that the data object passed in was a valid date
                // by ensuring that all the fields you set are equal to what's 
                // in the date object.
                //
                // for example, if you try to set a date with a month of September
                // and date of 31, the date object will normailize that to October 1
                if (data.explicit[field[0]] && d["get" + field[1]]() != f[field[0]]){
                    return null;
                }
            }
            d.parseMetadata = new Metadata(data.match, data.explicit);
            return d;
        },

        /**
         * Returns a simple JS structure for use in ambiguity rules
         */
        _dateData: function(date){
            var o = {
                fields:{
                    second:date.getSeconds(),
                    minute:date.getMinutes(),
                    hour:date.getHours(),
                    day:date.getDate(),
                    month:date.getMonth(),
                    year:date.getFullYear()
                },
                explicit:{},
                match:{},
                definite:{},
                order:date.parseMetadata.getOrder().slice(0)
            };
            
            $($.datejs._fields).each(function(i,field){
                o.explicit[field[0]] = date.parseMetadata.explicit(field[0]);
                o.match[field[0]] = date.parseMetadata.match(field[0]);
            });
            
            return o;
        },

        /*
         * Deep clones a date structure
         */
        _cloneDateData: function(data){
            var clone = {fields:{}, explicit:{}, match:{}, definite:{}};
            $(["fields", "explicit", "match", "definite"]).each(function(i,field){
                $.extend(clone[field], data[field]);
            });
            clone.order = data.order.slice(0);
            clone.toString = function(){
                var X = "X";
                    return "m: "+ ( (this.fields.month ? this.fields.month +1 :X) ) + " d: " + (this.fields.day||X) + " y: " + (this.fields.year||X);
            };
            return clone;
        },
        
        _isNumeric: function(s){ 
            return typeof(s) == "number" ? true : isNaN(parseInt(s)) ? false : true;
        },

        _humanDateFormats: ["MMM d, yyyy","MMM yyyy","yyyy"],
        _humanTimeFormats: [ "h:mm:sstt","h:mmtt", "htt"],
        _isoFormat : "yyyy-MM-ddTHH:mm:ss",
        _fields : [
            ["second","Seconds"],
            ["minute","Minutes"],
            ["hour","Hours"],
            ["day","Date"],
            ["month","Month"],
            ["year","FullYear"]
        ]
    };

    var Metadata = $.datejs.DateDataMetadata = function(match, explicit){
        this._match = match;
        this._explicit = explicit;
    };
    
    Metadata.prototype = {
        match: function(field){ 
            return this._match[field] || null;
        },
        
        explicit: function(field){
            return this._explicit[field];
        },
  
        relativeDay: function(){
            return false;
        }
    };
})(jQuery);
