"use strict";var datetimeHelpers=function(){var a=function(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")},b=function(b,c){var d=b.indexOf("|"),e=void 0,f=void 0;if(d>0){e=a(b.substring(0,d)).split(",");for(f in e)e.hasOwnProperty(f)&&(a(e[f]).match(/\{\{[a-zA-Z0-9_\-\.]+\}\}/)?e[f]=c(a(e[f])):e[f]=a(e[f]));return e}return[]},c={now:"Just now",minute:"1 minute",minutes:"X minutes",hour:"an hour",hours:"X hours",day:"1 day",days:"X days",ago:" ago",fromnow:" from now"},d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e=["January","February","March","April","May","June","July","August","September","October","November","December"],f=function(a){return d[a.getMonth()]+" "+a.getDate()+", "+a.getFullYear()},g=function(a){return d[a.getMonth()]+" "+(a.getDate()<10?"0"+a.getDate():a.getDate())+", "+a.getFullYear()},h=function(a){return d[a.getMonth()]+" "+a.getDate()},i=function(a,b){b=b||new Date;var d=(b.getTime()-a.getTime())/1e3,e=void 0,g=d<0?c.fromnow:c.ago;return d<0&&(a=b,d*=-1),(e=d<60?c.now:d<120?c.minute:d<3600?c.minutes.replace(/X/,Math.floor(d/60)):d<7200?c.hour:d<86400?c.hours.replace(/X/,Math.floor(d/3600)):d<172800?c.day:d<2678400?c.days.replace(/X/,Math.floor(d/86400)):"")?(e!==c.now&&(e+=g),e):f(a)},j={now:"now",justNow:"Just now",yesterday:"1d",minute:"Xm",hour:"Xh",day:"Xd",week:"Xw",year:"Xy"},k=function(a,b){b=b||new Date;var c=(b.getTime()-a.getTime())/1e3;c<0&&(c*=-1);return c<60?j.now:c<3600?j.minute.replace(/X/,Math.floor(c/60)):c<86400?j.hour.replace(/X/,Math.floor(c/3600)):c<604800?j.day.replace(/X/,Math.floor(c/86400)):c<31536e3?j.week.replace(/X/,Math.floor(c/604800)):j.year.replace(/X/,Math.floor(c/31536e3))},l=function(a,b){b=b||new Date;var c=(b.getTime()-a.getTime())/1e3;c<0&&(a=b,c*=-1);if(c<60)return j.justNow;if(c<3600)return j.minute.replace(/X/,Math.floor(c/60));if(c<86400)return j.hour.replace(/X/,Math.floor(c/3600));if(c<172800){var d=new Date(a.getFullYear(),a.getMonth(),a.getDate()),e=new Date(b.getFullYear(),b.getMonth(),b.getDate());return e.setDate(e.getDate()-1),e.getTime()===d.getTime()?j.yesterday:h(a)}return c<31536e3?h(a):f(a).replace(/,/g,"")};return{getFullDatestring:function(a){return f(a)},getShortDatestring:function(a){return h(a)},timeAgo:function(){return function(a,c){var d=b(a,c),e=d[0],f=d[1];return c(i(new Date(this[e]),new Date(this[f])))}},feedTimeAgo:function(){return function(a,c){var d=b(a,c),e=d[0],f=d[1],h=new Date(this[e]);return c('<span title="'+g(h).replace(/,/g,"")+'">'+l(h,new Date(this[f]))+"</span>")}},twitterTimeAgo:function(){return function(a,c){var d=b(a,c),e=d[0],g=d[1],h=new Date(this[e]);return c('<span title="'+f(h)+'">'+k(h,new Date(this[g]))+"</span>")}},shortDate:function(){return function(a,c){var d=b(a,c),g=d[0],h=new Date(this[g]);return c('<span title="'+f(h)+'">'+e[h.getMonth()]+" "+h.getFullYear()+"</span>")}}}}();"undefined"!=typeof module&&module.exports&&(module.exports=datetimeHelpers);