@firestitch/date
Advanced tools
Comparing version 8.0.15 to 8.0.16
@@ -0,0 +0,0 @@ import { ElementRef, OnChanges, OnInit } from '@angular/core'; |
@@ -0,0 +0,0 @@ export declare const SECONDS: { |
@@ -0,0 +0,0 @@ export declare const TIMEZONES: { |
@@ -0,0 +0,0 @@ import { ElementRef, OnChanges, OnInit, Renderer2 } from '@angular/core'; |
@@ -0,0 +0,0 @@ import { ModuleWithProviders } from '@angular/core'; |
@@ -0,0 +0,0 @@ import { PipeTransform } from '@angular/core'; |
@@ -0,0 +0,0 @@ import { PipeTransform } from '@angular/core'; |
@@ -0,0 +0,0 @@ import { PipeTransform } from '@angular/core'; |
@@ -0,0 +0,0 @@ import { PipeTransform } from '@angular/core'; |
import { FsDateFormatPipe } from './date-format.pipe'; | ||
export declare class FsDatePipe extends FsDateFormatPipe { | ||
} |
@@ -0,0 +0,0 @@ export declare class FsDateAgoFactory { |
@@ -672,2 +672,6 @@ (function (global, factory) { | ||
var toFormat = getFormatString(format); | ||
if (formatParts.indexOf('yearless') !== -1) { | ||
fromFormat = fromFormat.replace(' yyyy', ''); | ||
toFormat = toFormat.replace(' yyyy', ''); | ||
} | ||
if (dateFns.differenceInMilliseconds(from, to) == 0) { | ||
@@ -678,8 +682,19 @@ return dateFns.format(from, fromFormat); | ||
// date and time | ||
if (from.getFullYear() == to.getFullYear()) { | ||
toFormat = toFormat | ||
.replace(' yyyy', '') | ||
.replace(',', ''); | ||
if (!from.getMinutes()) { | ||
fromFormat = fromFormat.replace(':mm', ''); | ||
} | ||
if (!to.getMinutes()) { | ||
toFormat = toFormat.replace(':mm', ''); | ||
} | ||
if (from.getFullYear() === to.getFullYear()) { | ||
if ((new Date()).getFullYear() === from.getFullYear()) { | ||
fromFormat = fromFormat.replace(', yyyy', ''); | ||
} | ||
toFormat = toFormat.replace(', yyyy', ''); | ||
if (from.getMonth() == to.getMonth()) { | ||
if (from.getDate() == to.getDate()) { | ||
if ((from.getHours() <= 12 && to.getHours() <= 12) || | ||
(from.getHours() >= 12 && to.getHours() >= 12)) { | ||
fromFormat = fromFormat.replace(' aaa', ''); | ||
} | ||
toFormat = toFormat | ||
@@ -724,3 +739,3 @@ .replace('MMMM', '') | ||
if (from.getDate() == to.getDate()) { | ||
if (formatParts.indexOf('time') == -1) { | ||
if (formatParts.indexOf('time') === -1) { | ||
fromFormat = getFormatString(format); | ||
@@ -736,3 +751,3 @@ toFormat = ''; | ||
if (toFormat) { | ||
output += ' - ' + dateFns.format(to, toFormat); | ||
output += ' – ' + dateFns.format(to, toFormat); | ||
} | ||
@@ -739,0 +754,0 @@ return output; |
@@ -1,2 +0,2 @@ | ||
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("@angular/core"),require("@angular/material/tooltip"),require("@angular/common"),require("@firestitch/common"),require("lodash-es"),require("date-fns"),require("rxjs"),require("date-fns-tz")):"function"==typeof define&&define.amd?define("@firestitch/date",["exports","@angular/core","@angular/material/tooltip","@angular/common","@firestitch/common","lodash-es","date-fns","rxjs","date-fns-tz"],a):a(((e=e||self).firestitch=e.firestitch||{},e.firestitch.date={}),e.ng.core,e.ng.material.tooltip,e.ng.common,e.common$1,e.lodashEs,e.dateFns,e.rxjs,e.dateFnsTz)}(this,(function(e,a,n,t,o,r,u,s,i){"use strict"; | ||
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("@angular/core"),require("@angular/material/tooltip"),require("@angular/common"),require("@firestitch/common"),require("lodash-es"),require("date-fns"),require("rxjs"),require("date-fns-tz")):"function"==typeof define&&define.amd?define("@firestitch/date",["exports","@angular/core","@angular/material/tooltip","@angular/common","@firestitch/common","lodash-es","date-fns","rxjs","date-fns-tz"],a):a(((e=e||self).firestitch=e.firestitch||{},e.firestitch.date={}),e.ng.core,e.ng.material.tooltip,e.ng.common,e.common$1,e.lodashEs,e.dateFns,e.rxjs,e.dateFnsTz)}(this,(function(e,a,n,t,o,r,u,s,l){"use strict"; | ||
/*! ***************************************************************************** | ||
@@ -15,3 +15,3 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
and limitations under the License. | ||
***************************************************************************** */var l=function(e,a){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var n in a)a.hasOwnProperty(n)&&(e[n]=a[n])})(e,a)};function m(e){void 0===e&&(e="date");var a=e.split("-"),n=-1!=a.indexOf("time"),t=-1!=a.indexOf("date"),o=[];if(t||n){if(t){var r=-1===a.indexOf("yearless");if(-1!=a.indexOf("day")&&o.push(-1!=a.indexOf("full")?"EEEE":"EEE"),o.push(-1!=a.indexOf("full")?"MMMM":"MMM"),-1===a.indexOf("dayless")){var u=-1!=a.indexOf("ordinal")?"do":"d";r&&(u+=","),o.push(u)}r&&o.push("yyyy")}n&&(o.push(-1!=a.indexOf("24")?"HH:mm":"h:mm aaa"),-1==a.indexOf("tz")&&-1==a.indexOf("gmt")||o.push("('GMT'XXX')'"))}else o.push(e);return o.join(" ").trim()}function v(e){return"string"==typeof e&&(e=u.parseISO(e)),u.isValid(e)?e:null}function T(e,a){var n=m(a);return(e=v(e))?u.format(e,n):null}var d={YEAR:31536e3,MONTH:86400*30.417,DAY:86400,HOUR:3600,MINUTE:60};function p(e){var a=0;return e||"string"==typeof e?((e=e.trim().replace(/(\d+)\s+/g,"$1").replace(/\s+/," ").replace(/^\./,"0.")).split(" ").forEach((function(e){var n=e.match(/^(\d+\.?\d*)([YMdhms])$/);if(n){var t={Y:d.YEAR,M:d.MONTH,d:d.DAY,h:d.HOUR,m:d.MINUTE,s:1}[n[2]];a+=Math.round(+n[1])*t}})),s.of({time:a})):s.of({error:"Invalid duration format"})}function c(e,a){if(!r.isNumber(e)){var n;if(p(e).subscribe((function(e){n=e})),n&&n.error||!n.time)return"error";e=n.time,a.unit="seconds"}"string"==typeof a&&(a={seconds:!!a.match(/second/),minutes:!!a.match(/minute/),hours:!!a.match(/hour/),days:!!a.match(/day/),months:!!a.match(/month/),years:!!a.match(/year/)}),(a=Object.assign({},a)).unit=void 0===a.unit?"seconds":a.unit,a.abr=void 0===a.abr||a.abr,a.suffix=!0===a.suffix?e>0?" ago":" from now":"",a.pad=void 0!==a.pad&&a.pad,a.thousandsSeperator=void 0!==a.thousandsSeperator&&a.thousandsSeperator,a.seconds||a.minutes||a.hours||a.days||a.months||a.years?(a.seconds=void 0!==a.seconds&&a.seconds,a.minutes=void 0!==a.minutes&&a.minutes,a.hours=void 0!==a.hours&&a.hours,a.days=void 0!==a.days&&a.days,a.months=void 0!==a.months&&a.months,a.years=void 0!==a.years&&a.years):(a.seconds=!0,a.minutes=!1,a.hours=!1,a.days=!1,a.months=!1,a.years=!1),"minutes"===a.unit?e*=60:"hours"===a.unit&&(e=60*e*60),e=Math.abs(parseInt(e));var t={years:{abr:"Y",single:"year",plural:"years",seconds:d.YEAR,next:"months"},months:{abr:"M",single:"month",plural:"months",seconds:d.MONTH,next:"days"},days:{abr:"d",single:"day",plural:"days",seconds:d.DAY,next:"hours"},hours:{abr:"h",single:"hour",plural:"hours",seconds:d.HOUR,next:"months"},minutes:{abr:"m",single:"minute",plural:"minutes",seconds:d.MINUTE,next:"seconds"},seconds:{abr:"s",single:"second",plural:"seconds",seconds:1,next:null}},o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0},u=e;if(a.years){var s=u/d.YEAR;s>=1&&(a.months||a.days||a.hours||a.minutes||a.seconds?o.years=Math.floor(s):o.years=Math.round(s),u-=o.years*d.YEAR)}if(a.months){var i=u/d.MONTH;i>=1&&(a.days||a.hours||a.minutes||a.seconds?o.months=Math.floor(i):o.months=Math.round(i),u-=o.months*d.MONTH)}if(a.days){var l=u/d.DAY;l>=1&&(a.hours||a.minutes||a.seconds?o.days=Math.floor(l):o.days=Math.round(l),u-=o.days*d.DAY)}if(a.hours){var m=u/d.HOUR;m>=1&&(a.minutes||a.seconds?o.hours=Math.floor(m):o.hours=Math.round(m),u-=o.hours*d.HOUR)}if(a.minutes){var v=u/60;v>=1&&(a.seconds?o.minutes=Math.floor(v):o.minutes=Math.round(v),u-=o.minutes*d.MINUTE)}o.seconds=Math.round(u);var T=[],c=0;for(var h in t)t.hasOwnProperty(h)&&(a[h]&&T.push(h),c+=o[h]*t[h].seconds);var y=[];if(1===T.length){a.precision=void 0===a.precision?1:a.precision;var g=T.join(""),M=f(c/t[g].seconds,a);y.push(M+(a.abr?t[g].abr:" "+(1==M?t[g].single:t[g].plural)))}else for(var A in a.precision=void 0===a.precision?T.length:a.precision,t)if(t.hasOwnProperty(A)){if(a.precision&&y.length>=a.precision)continue;if(a[A])(M=o[A])&&y.push(f(M,a)+(a.abr?t[A].abr:" "+(1==M?t[A].single:t[A].plural)))}if(0===y.length)for(var S in t)t.hasOwnProperty(S)&&a[S]&&(y=[f(0,a)+(a.abr?t[S].abr:" "+(1==t[S]?t[S].single:t[S].plural))]);return a.maxOutputs&&a.maxOutputs<y.length&&(y=y.splice(0,a.maxOutputs)),a.suffix&&y.push(a.suffix),y.join(" ")}function f(e,a){void 0===a&&(a={});var n=void 0===a.precision?-1:a.precision,t=void 0!==a.pad&&a.pad,o=void 0!==a.thousandsSeperator&&a.thousandsSeperator;return n>=0&&t&&o?r.round(e,n).toLocaleString("en-US",{minimumFractionDigits:n}):n>=0&&t?e.toFixed(n):n>=0?r.round(e,n):o?e.toLocaleString("en-US"):e}function h(e,a){if(void 0===a&&(a="date"),!(e=v(e)))return"";var n=r.round(u.differenceInSeconds(new Date,e)/60,0),t=r.round(u.differenceInMinutes(new Date,e)/60,0);return Math.abs(t)>=24?e.getFullYear()==(new Date).getFullYear()?T(e,"date-yearless"):T(e,a):0==t&&0==n?"now":c(n,{unit:"minutes",suffix:!0,minutes:!0,hours:!0})}function y(e,a,n){if(void 0===n&&(n="date"),e=v(e),!(a=v(a))&&!e)return"";e&&!a&&(a=e),a&&!e&&(e=a);var t=n.split("-"),o=m(n),r=m(n);if(0==u.differenceInMilliseconds(e,a))return u.format(e,o);-1!==t.indexOf("time")?e.getFullYear()==a.getFullYear()&&(r=r.replace(" yyyy","").replace(",",""),r=e.getMonth()==a.getMonth()&&e.getDate()==a.getDate()?r.replace("MMMM","").replace("MMM","").replace("EEEE","").replace("EEE","").replace(" do","").replace(" d","").trim():r.replace(" do"," do,").replace(" d"," d,")):e.getFullYear()==a.getFullYear()&&(o=o.replace(" yyyy","").replace(",","").trim(),e.getMonth()==a.getMonth()&&(-1==t.indexOf("day")&&(r=r.replace("MMMM","").replace("MMM","").trim()),e.getDate()==a.getDate()&&-1==t.indexOf("time")&&(o=m(n),r="")));var s=u.format(e,o);return r&&(s+=" - "+u.format(a,r)),s}var g=function(){function e(){}return e.prototype.transform=function(e,a){return T(e,a)},e.decorators=[{type:a.Pipe,args:[{name:"fsDateFormat"}]}],e}(),M=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return function(e,a){function n(){this.constructor=e}l(e,a),e.prototype=null===a?Object.create(a):(n.prototype=a.prototype,new n)}(n,e),n.decorators=[{type:a.Pipe,args:[{name:"fsDate"}]}],n}(g),A=function(){function e(){}return e.prototype.transform=function(e,a){return y(e[0],e[1],a)},e.decorators=[{type:a.Pipe,args:[{name:"fsDateRange"}]}],e}(),S=function(){function e(){}return e.prototype.transform=function(e,a){return c(e,a)},e.decorators=[{type:a.Pipe,args:[{name:"fsDateDuration"}]}],e}(),D=function(){function e(){}return e.prototype.transform=function(e,a){return h(e,a)},e.decorators=[{type:a.Pipe,args:[{name:"fsDateAgo"}]}],e}(),E=function(){function e(e){this.elementRef=e,this.date=null,this.showTime=!1,this.format="date",this.showTooltip=!0,this.tooltipDateFormat=null,this.formattedDate=null,this.tooltip=null}return e.prototype.ngOnInit=function(){this.updateFormatted()},e.prototype.ngOnChanges=function(){this.updateFormatted()},e.prototype.updateFormatted=function(){if(this.formattedDate=h(this.date,this.format),this.showTooltip){var e=this.getTooltipFormat(),a=this.getTooltipAgo();this.tooltip=T(this.date,e)+" · "+a}},e.prototype.getTooltipFormat=function(){if(this.tooltipDateFormat)return this.tooltipDateFormat;var e="date-time";return(new Date).getFullYear()===new Date(this.date).getFullYear()&&(e="date-time-yearless"),e},e.prototype.getTooltipAgo=function(){var e="now",a=v(this.date);if(!a)return"";var n=u.differenceInSeconds(new Date,a);return(n>59||n<0)&&(e=c(n,{maxOutputs:1,suffix:!0,years:!0,months:!0,days:!0,hours:!0,minutes:!0})),e},e.decorators=[{type:a.Component,args:[{selector:"fs-date-ago",template:'<span [matTooltip]="tooltip">{{ formattedDate }}</span>\n',changeDetection:a.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:a.ElementRef}]},e.propDecorators={date:[{type:a.Input}],showTime:[{type:a.Input}],format:[{type:a.Input}],showTooltip:[{type:a.Input}],tooltipDateFormat:[{type:a.Input}]},e}();var C=function(){function e(e){this.factoryResolver=null,this.rootViewContainer=null,this.factoryResolver=e}return e.prototype.setRootViewContainerRef=function(e){this.rootViewContainer=e},e.prototype.addDynamicComponent=function(){var e=this.factoryResolver.resolveComponentFactory(E).create(this.rootViewContainer.injector);return this.rootViewContainer.insert(e.hostView),e},e.decorators=[{type:a.Injectable}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:a.Inject,args:[a.ComponentFactoryResolver]}]}]},e}();var O=function(){function e(e,a,n,t){this.fsDateAgoFactory=e,this.renderer=a,this.elementRef=n,this.viewContainerRef=t,this.date=null,this.showTime=!1,this.format="date",this.dateAgoRef=null}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(){this.renderDateAgo()},e.prototype.renderDateAgo=function(){this.removeDateAgo(),this.fsDateAgoFactory.setRootViewContainerRef(this.viewContainerRef),this.dateAgoRef=this.fsDateAgoFactory.addDynamicComponent(),Object.assign(this.dateAgoRef.instance,{date:this.date,showTime:this.showTime,format:this.format})},e.prototype.removeDateAgo=function(){this.dateAgoRef&&this.renderer.removeChild(this.elementRef.nativeElement,this.dateAgoRef.instance.elementRef.nativeElement)},e.decorators=[{type:a.Directive,args:[{selector:"[fsDateAgo]"}]}],e.ctorParameters=function(){return[{type:C},{type:a.Renderer2},{type:a.ElementRef},{type:void 0,decorators:[{type:a.Inject,args:[a.ViewContainerRef]}]}]},e.propDecorators={date:[{type:a.Input}],showTime:[{type:a.Input}],format:[{type:a.Input}]},e}();var F=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[C]}},e.decorators=[{type:a.NgModule,args:[{imports:[t.CommonModule,n.MatTooltipModule,o.FsCommonModule],exports:[M,D,S,g,A,O,E],entryComponents:[E],declarations:[M,D,S,g,A,O,E],providers:[]}]}],e}();e.FsDateAgoFactory=C,e.FsDateAgoPipe=D,e.FsDateDurationPipe=S,e.FsDateFormatPipe=g,e.FsDateModule=F,e.FsDatePipe=M,e.FsDateRangePipe=A,e.SECONDS=d,e.TIMEZONES=[{name:"A",value:"1"},{name:"ACDT",value:"10:30"},{name:"ACST",value:"9:30"},{name:"ADT",value:"-3"},{name:"ADT",value:"-3"},{name:"AEDT",value:"11"},{name:"AEST",value:"10"},{name:"AFT",value:"4:30"},{name:"AKDT",value:"-8"},{name:"AKST",value:"-9"},{name:"ALMT",value:"6"},{name:"AMST",value:"5"},{name:"AMST",value:"-3"},{name:"AMT",value:"4"},{name:"AMT",value:"-4"},{name:"ANAST",value:"12"},{name:"ANAT",value:"12"},{name:"AQTT",value:"5"},{name:"ART",value:"-3"},{name:"AST",value:"3"},{name:"AST",value:"-4"},{name:"AWDT",value:"9"},{name:"AWST",value:"8"},{name:"AZOST",value:"0"},{name:"AZOT",value:"-1"},{name:"AZST",value:"5"},{name:"AZT",value:"4"},{name:"B",value:"2"},{name:"BNT",value:"8"},{name:"BOT",value:"-4"},{name:"BRST",value:"-2"},{name:"BRT",value:"-3"},{name:"BST",value:"6"},{name:"BST",value:"1"},{name:"BTT",value:"6"},{name:"C",value:"3"},{name:"CAST",value:"8"},{name:"CAT",value:"2"},{name:"CCT",value:"6:30"},{name:"CDT",value:"-4"},{name:"CDT",value:"-5"},{name:"CEST",value:"2"},{name:"CET",value:"1"},{name:"CHADT",value:"13:45"},{name:"CHAST",value:"12:45"},{name:"CKT",value:"-10"},{name:"CLST",value:"-3"},{name:"CLT",value:"-4"},{name:"COT",value:"-5"},{name:"CST",value:"8"},{name:"CST",value:"-6"},{name:"CST",value:"-5"},{name:"CVT",value:"-1"},{name:"CXT",value:"7"},{name:"ChST",value:"10"},{name:"D",value:"4"},{name:"DAVT",value:"7"},{name:"E",value:"5"},{name:"EASST",value:"-5"},{name:"EAST",value:"-6"},{name:"EAT",value:"3"},{name:"EAT",value:"3"},{name:"ECT",value:"-5"},{name:"EDT",value:"-4"},{name:"EEST",value:"3"},{name:"EET",value:"2"},{name:"EGST",value:"0"},{name:"EGT",value:"-1"},{name:"EST",value:"-5"},{name:"ET",value:"-5"},{name:"F",value:"6"},{name:"FJST",value:"13"},{name:"FJT",value:"12"},{name:"FKST",value:"-3"},{name:"FKT",value:"-4"},{name:"FNT",value:"-2"},{name:"G",value:"7"},{name:"GALT",value:"-6"},{name:"GAMT",value:"-9"},{name:"GET",value:"4"},{name:"GFT",value:"-3"},{name:"GILT",value:"12"},{name:"GMT",value:"0"},{name:"GST",value:"4"},{name:"GYT",value:"-4"},{name:"H",value:"8"},{name:"HAA",value:"-3"},{name:"HAC",value:"-5"},{name:"HADT",value:"-9"},{name:"HAE",value:"-4"},{name:"HAP",value:"-7"},{name:"HAR",value:"-6"},{name:"HAST",value:"-10"},{name:"HAT",value:"-2:30"},{name:"HAY",value:"-8"},{name:"HKT",value:"8"},{name:"HLV",value:"-4:30"},{name:"HNA",value:"-4"},{name:"HNC",value:"-6"},{name:"HNE",value:"-5"},{name:"HNP",value:"-8"},{name:"HNR",value:"-7"},{name:"HNT",value:"-3:30"},{name:"HNY",value:"-9"},{name:"HOVT",value:"7"},{name:"I",value:"9"},{name:"ICT",value:"7"},{name:"IDT",value:"3"},{name:"IOT",value:"6"},{name:"IRDT",value:"4:30"},{name:"IRKST",value:"9"},{name:"IRKT",value:"9"},{name:"IRST",value:"3:30"},{name:"IST",value:"2"},{name:"IST",value:"5:30"},{name:"IST",value:"1"},{name:"JST",value:"9"},{name:"K",value:"10"},{name:"KGT",value:"6"},{name:"KRAST",value:"8"},{name:"KRAT",value:"8"},{name:"KST",value:"9"},{name:"KUYT",value:"4"},{name:"L",value:"11"},{name:"LHDT",value:"11"},{name:"LHST",value:"10:30"},{name:"LINT",value:"14"},{name:"M",value:"12"},{name:"MAGST",value:"12"},{name:"MAGT",value:"12"},{name:"MART",value:"-9:30"},{name:"MAWT",value:"5"},{name:"MDT",value:"-6"},{name:"MESZ",value:"2"},{name:"MEZ",value:"1"},{name:"MHT",value:"12"},{name:"MMT",value:"6:30"},{name:"MSD",value:"4"},{name:"MSK",value:"4"},{name:"MST",value:"-7"},{name:"MUT",value:"4"},{name:"MVT",value:"5"},{name:"MYT",value:"8"},{name:"N",value:"-1"},{name:"NCT",value:"11"},{name:"NDT",value:"-2:30"},{name:"NFT",value:"11:30"},{name:"NOVST",value:"7"},{name:"NOVT",value:"6"},{name:"NPT",value:"5:45"},{name:"NST",value:"-3:30"},{name:"NUT",value:"-11"},{name:"NZDT",value:"13"},{name:"NZST",value:"12"},{name:"O",value:"-2"},{name:"OMSST",value:"7"},{name:"OMST",value:"7"},{name:"P",value:"-3"},{name:"PDT",value:"-7"},{name:"PET",value:"-5"},{name:"PETST",value:"12"},{name:"PETT",value:"12"},{name:"PGT",value:"10"},{name:"PHOT",value:"13"},{name:"PHT",value:"8"},{name:"PKT",value:"5"},{name:"PMDT",value:"-2"},{name:"PMST",value:"-3"},{name:"PONT",value:"11"},{name:"PST",value:"-8"},{name:"PST",value:"-8"},{name:"PT",value:"-8"},{name:"PWT",value:"9"},{name:"PYST",value:"-3"},{name:"PYT",value:"-4"},{name:"Q",value:"-4"},{name:"R",value:"-5"},{name:"RET",value:"4"},{name:"S",value:"-6"},{name:"SAMT",value:"4"},{name:"SAST",value:"2"},{name:"SBT",value:"11"},{name:"SCT",value:"4"},{name:"SGT",value:"8"},{name:"SRT",value:"-3"},{name:"SST",value:"-11"},{name:"T",value:"-7"},{name:"TAHT",value:"-10"},{name:"TFT",value:"5"},{name:"TJT",value:"5"},{name:"TKT",value:"13"},{name:"TLT",value:"9"},{name:"TMT",value:"5"},{name:"TVT",value:"12"},{name:"U",value:"-8"},{name:"ULAT",value:"8"},{name:"UTC",value:"0"},{name:"UYST",value:"-2"},{name:"UYT",value:"-3"},{name:"UZT",value:"5"},{name:"V",value:"-9"},{name:"VET",value:"-4:30"},{name:"VLAST",value:"11"},{name:"VLAT",value:"11"},{name:"VUT",value:"11"},{name:"W",value:"-10"},{name:"WAST",value:"2"},{name:"WAT",value:"1"},{name:"WEST",value:"1"},{name:"WESZ",value:"1"},{name:"WET",value:"0"},{name:"WEZ",value:"0"},{name:"WFT",value:"12"},{name:"WGST",value:"-2"},{name:"WGT",value:"-3"},{name:"WIB",value:"7"},{name:"WIT",value:"9"},{name:"WITA",value:"8"},{name:"WST",value:"1"},{name:"WST",value:"13"},{name:"WT",value:"0"},{name:"X",value:"-11"},{name:"Y",value:"-12"},{name:"YAKST",value:"10"},{name:"YAKT",value:"10"},{name:"YAPT",value:"10"},{name:"YEKST",value:"6"},{name:"YEKT",value:"6"},{name:"Z",value:"0"}],e.ago=h,e.date=function(e){var a="string"==typeof e?u.parseISO(e):e;return u.isValid(a)||(a=null),a},e.duration=c,e.format=T,e.getFormatString=m,e.granularDuration=function(e,a){return void 0===a&&(a={}),a.seconds=void 0!==a.seconds&&a.seconds,a.months=void 0!==a.months&&a.months,a.years=void 0!==a.years&&a.years,a.precision=void 0===a.precision?3:a.precision,c(e,a)},e.iso8601=function(e){return(e=v(e))?u.format(e,"yyyy-MM-dd'T'HH:mm:ssxxx"):""},e.parse=v,e.parseDuration=p,e.parseLocal=function(e){return"string"==typeof e&&(e=i.utcToZonedTime(e,null)),u.isValid(e)?e:null},e.range=y,e.simpleFormat=function(e){return u.format(e,"yyyy-MM-dd'T'HH:mm:ssxxxxx")},e.toUTC=function(e){var a=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(a)},e.ɵa=O,e.ɵb=E,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */var i=function(e,a){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var n in a)a.hasOwnProperty(n)&&(e[n]=a[n])})(e,a)};function m(e){void 0===e&&(e="date");var a=e.split("-"),n=-1!=a.indexOf("time"),t=-1!=a.indexOf("date"),o=[];if(t||n){if(t){var r=-1===a.indexOf("yearless");if(-1!=a.indexOf("day")&&o.push(-1!=a.indexOf("full")?"EEEE":"EEE"),o.push(-1!=a.indexOf("full")?"MMMM":"MMM"),-1===a.indexOf("dayless")){var u=-1!=a.indexOf("ordinal")?"do":"d";r&&(u+=","),o.push(u)}r&&o.push("yyyy")}n&&(o.push(-1!=a.indexOf("24")?"HH:mm":"h:mm aaa"),-1==a.indexOf("tz")&&-1==a.indexOf("gmt")||o.push("('GMT'XXX')'"))}else o.push(e);return o.join(" ").trim()}function v(e){return"string"==typeof e&&(e=u.parseISO(e)),u.isValid(e)?e:null}function d(e,a){var n=m(a);return(e=v(e))?u.format(e,n):null}var T={YEAR:31536e3,MONTH:86400*30.417,DAY:86400,HOUR:3600,MINUTE:60};function p(e){var a=0;return e||"string"==typeof e?((e=e.trim().replace(/(\d+)\s+/g,"$1").replace(/\s+/," ").replace(/^\./,"0.")).split(" ").forEach((function(e){var n=e.match(/^(\d+\.?\d*)([YMdhms])$/);if(n){var t={Y:T.YEAR,M:T.MONTH,d:T.DAY,h:T.HOUR,m:T.MINUTE,s:1}[n[2]];a+=Math.round(+n[1])*t}})),s.of({time:a})):s.of({error:"Invalid duration format"})}function c(e,a){if(!r.isNumber(e)){var n;if(p(e).subscribe((function(e){n=e})),n&&n.error||!n.time)return"error";e=n.time,a.unit="seconds"}"string"==typeof a&&(a={seconds:!!a.match(/second/),minutes:!!a.match(/minute/),hours:!!a.match(/hour/),days:!!a.match(/day/),months:!!a.match(/month/),years:!!a.match(/year/)}),(a=Object.assign({},a)).unit=void 0===a.unit?"seconds":a.unit,a.abr=void 0===a.abr||a.abr,a.suffix=!0===a.suffix?e>0?" ago":" from now":"",a.pad=void 0!==a.pad&&a.pad,a.thousandsSeperator=void 0!==a.thousandsSeperator&&a.thousandsSeperator,a.seconds||a.minutes||a.hours||a.days||a.months||a.years?(a.seconds=void 0!==a.seconds&&a.seconds,a.minutes=void 0!==a.minutes&&a.minutes,a.hours=void 0!==a.hours&&a.hours,a.days=void 0!==a.days&&a.days,a.months=void 0!==a.months&&a.months,a.years=void 0!==a.years&&a.years):(a.seconds=!0,a.minutes=!1,a.hours=!1,a.days=!1,a.months=!1,a.years=!1),"minutes"===a.unit?e*=60:"hours"===a.unit&&(e=60*e*60),e=Math.abs(parseInt(e));var t={years:{abr:"Y",single:"year",plural:"years",seconds:T.YEAR,next:"months"},months:{abr:"M",single:"month",plural:"months",seconds:T.MONTH,next:"days"},days:{abr:"d",single:"day",plural:"days",seconds:T.DAY,next:"hours"},hours:{abr:"h",single:"hour",plural:"hours",seconds:T.HOUR,next:"months"},minutes:{abr:"m",single:"minute",plural:"minutes",seconds:T.MINUTE,next:"seconds"},seconds:{abr:"s",single:"second",plural:"seconds",seconds:1,next:null}},o={years:0,months:0,days:0,hours:0,minutes:0,seconds:0},u=e;if(a.years){var s=u/T.YEAR;s>=1&&(a.months||a.days||a.hours||a.minutes||a.seconds?o.years=Math.floor(s):o.years=Math.round(s),u-=o.years*T.YEAR)}if(a.months){var l=u/T.MONTH;l>=1&&(a.days||a.hours||a.minutes||a.seconds?o.months=Math.floor(l):o.months=Math.round(l),u-=o.months*T.MONTH)}if(a.days){var i=u/T.DAY;i>=1&&(a.hours||a.minutes||a.seconds?o.days=Math.floor(i):o.days=Math.round(i),u-=o.days*T.DAY)}if(a.hours){var m=u/T.HOUR;m>=1&&(a.minutes||a.seconds?o.hours=Math.floor(m):o.hours=Math.round(m),u-=o.hours*T.HOUR)}if(a.minutes){var v=u/60;v>=1&&(a.seconds?o.minutes=Math.floor(v):o.minutes=Math.round(v),u-=o.minutes*T.MINUTE)}o.seconds=Math.round(u);var d=[],c=0;for(var h in t)t.hasOwnProperty(h)&&(a[h]&&d.push(h),c+=o[h]*t[h].seconds);var y=[];if(1===d.length){a.precision=void 0===a.precision?1:a.precision;var g=d.join(""),M=f(c/t[g].seconds,a);y.push(M+(a.abr?t[g].abr:" "+(1==M?t[g].single:t[g].plural)))}else for(var A in a.precision=void 0===a.precision?d.length:a.precision,t)if(t.hasOwnProperty(A)){if(a.precision&&y.length>=a.precision)continue;if(a[A])(M=o[A])&&y.push(f(M,a)+(a.abr?t[A].abr:" "+(1==M?t[A].single:t[A].plural)))}if(0===y.length)for(var S in t)t.hasOwnProperty(S)&&a[S]&&(y=[f(0,a)+(a.abr?t[S].abr:" "+(1==t[S]?t[S].single:t[S].plural))]);return a.maxOutputs&&a.maxOutputs<y.length&&(y=y.splice(0,a.maxOutputs)),a.suffix&&y.push(a.suffix),y.join(" ")}function f(e,a){void 0===a&&(a={});var n=void 0===a.precision?-1:a.precision,t=void 0!==a.pad&&a.pad,o=void 0!==a.thousandsSeperator&&a.thousandsSeperator;return n>=0&&t&&o?r.round(e,n).toLocaleString("en-US",{minimumFractionDigits:n}):n>=0&&t?e.toFixed(n):n>=0?r.round(e,n):o?e.toLocaleString("en-US"):e}function h(e,a){if(void 0===a&&(a="date"),!(e=v(e)))return"";var n=r.round(u.differenceInSeconds(new Date,e)/60,0),t=r.round(u.differenceInMinutes(new Date,e)/60,0);return Math.abs(t)>=24?e.getFullYear()==(new Date).getFullYear()?d(e,"date-yearless"):d(e,a):0==t&&0==n?"now":c(n,{unit:"minutes",suffix:!0,minutes:!0,hours:!0})}function y(e,a,n){if(void 0===n&&(n="date"),e=v(e),!(a=v(a))&&!e)return"";e&&!a&&(a=e),a&&!e&&(e=a);var t=n.split("-"),o=m(n),r=m(n);if(-1!==t.indexOf("yearless")&&(o=o.replace(" yyyy",""),r=r.replace(" yyyy","")),0==u.differenceInMilliseconds(e,a))return u.format(e,o);-1!==t.indexOf("time")?(e.getMinutes()||(o=o.replace(":mm","")),a.getMinutes()||(r=r.replace(":mm","")),e.getFullYear()===a.getFullYear()&&((new Date).getFullYear()===e.getFullYear()&&(o=o.replace(", yyyy","")),r=r.replace(", yyyy",""),e.getMonth()==a.getMonth()&&e.getDate()==a.getDate()?((e.getHours()<=12&&a.getHours()<=12||e.getHours()>=12&&a.getHours()>=12)&&(o=o.replace(" aaa","")),r=r.replace("MMMM","").replace("MMM","").replace("EEEE","").replace("EEE","").replace(" do","").replace(" d","").trim()):r=r.replace(" do"," do,").replace(" d"," d,"))):e.getFullYear()==a.getFullYear()&&(o=o.replace(" yyyy","").replace(",","").trim(),e.getMonth()==a.getMonth()&&(-1==t.indexOf("day")&&(r=r.replace("MMMM","").replace("MMM","").trim()),e.getDate()==a.getDate()&&-1===t.indexOf("time")&&(o=m(n),r="")));var s=u.format(e,o);return r&&(s+=" – "+u.format(a,r)),s}var g=function(){function e(){}return e.prototype.transform=function(e,a){return d(e,a)},e.decorators=[{type:a.Pipe,args:[{name:"fsDateFormat"}]}],e}(),M=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return function(e,a){function n(){this.constructor=e}i(e,a),e.prototype=null===a?Object.create(a):(n.prototype=a.prototype,new n)}(n,e),n.decorators=[{type:a.Pipe,args:[{name:"fsDate"}]}],n}(g),A=function(){function e(){}return e.prototype.transform=function(e,a){return y(e[0],e[1],a)},e.decorators=[{type:a.Pipe,args:[{name:"fsDateRange"}]}],e}(),S=function(){function e(){}return e.prototype.transform=function(e,a){return c(e,a)},e.decorators=[{type:a.Pipe,args:[{name:"fsDateDuration"}]}],e}(),D=function(){function e(){}return e.prototype.transform=function(e,a){return h(e,a)},e.decorators=[{type:a.Pipe,args:[{name:"fsDateAgo"}]}],e}(),E=function(){function e(e){this.elementRef=e,this.date=null,this.showTime=!1,this.format="date",this.showTooltip=!0,this.tooltipDateFormat=null,this.formattedDate=null,this.tooltip=null}return e.prototype.ngOnInit=function(){this.updateFormatted()},e.prototype.ngOnChanges=function(){this.updateFormatted()},e.prototype.updateFormatted=function(){if(this.formattedDate=h(this.date,this.format),this.showTooltip){var e=this.getTooltipFormat(),a=this.getTooltipAgo();this.tooltip=d(this.date,e)+" · "+a}},e.prototype.getTooltipFormat=function(){if(this.tooltipDateFormat)return this.tooltipDateFormat;var e="date-time";return(new Date).getFullYear()===new Date(this.date).getFullYear()&&(e="date-time-yearless"),e},e.prototype.getTooltipAgo=function(){var e="now",a=v(this.date);if(!a)return"";var n=u.differenceInSeconds(new Date,a);return(n>59||n<0)&&(e=c(n,{maxOutputs:1,suffix:!0,years:!0,months:!0,days:!0,hours:!0,minutes:!0})),e},e.decorators=[{type:a.Component,args:[{selector:"fs-date-ago",template:'<span [matTooltip]="tooltip">{{ formattedDate }}</span>\n',changeDetection:a.ChangeDetectionStrategy.OnPush}]}],e.ctorParameters=function(){return[{type:a.ElementRef}]},e.propDecorators={date:[{type:a.Input}],showTime:[{type:a.Input}],format:[{type:a.Input}],showTooltip:[{type:a.Input}],tooltipDateFormat:[{type:a.Input}]},e}();var O=function(){function e(e){this.factoryResolver=null,this.rootViewContainer=null,this.factoryResolver=e}return e.prototype.setRootViewContainerRef=function(e){this.rootViewContainer=e},e.prototype.addDynamicComponent=function(){var e=this.factoryResolver.resolveComponentFactory(E).create(this.rootViewContainer.injector);return this.rootViewContainer.insert(e.hostView),e},e.decorators=[{type:a.Injectable}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:a.Inject,args:[a.ComponentFactoryResolver]}]}]},e}();var C=function(){function e(e,a,n,t){this.fsDateAgoFactory=e,this.renderer=a,this.elementRef=n,this.viewContainerRef=t,this.date=null,this.showTime=!1,this.format="date",this.dateAgoRef=null}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(){this.renderDateAgo()},e.prototype.renderDateAgo=function(){this.removeDateAgo(),this.fsDateAgoFactory.setRootViewContainerRef(this.viewContainerRef),this.dateAgoRef=this.fsDateAgoFactory.addDynamicComponent(),Object.assign(this.dateAgoRef.instance,{date:this.date,showTime:this.showTime,format:this.format})},e.prototype.removeDateAgo=function(){this.dateAgoRef&&this.renderer.removeChild(this.elementRef.nativeElement,this.dateAgoRef.instance.elementRef.nativeElement)},e.decorators=[{type:a.Directive,args:[{selector:"[fsDateAgo]"}]}],e.ctorParameters=function(){return[{type:O},{type:a.Renderer2},{type:a.ElementRef},{type:void 0,decorators:[{type:a.Inject,args:[a.ViewContainerRef]}]}]},e.propDecorators={date:[{type:a.Input}],showTime:[{type:a.Input}],format:[{type:a.Input}]},e}();var F=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[O]}},e.decorators=[{type:a.NgModule,args:[{imports:[t.CommonModule,n.MatTooltipModule,o.FsCommonModule],exports:[M,D,S,g,A,C,E],entryComponents:[E],declarations:[M,D,S,g,A,C,E],providers:[]}]}],e}();e.FsDateAgoFactory=O,e.FsDateAgoPipe=D,e.FsDateDurationPipe=S,e.FsDateFormatPipe=g,e.FsDateModule=F,e.FsDatePipe=M,e.FsDateRangePipe=A,e.SECONDS=T,e.TIMEZONES=[{name:"A",value:"1"},{name:"ACDT",value:"10:30"},{name:"ACST",value:"9:30"},{name:"ADT",value:"-3"},{name:"ADT",value:"-3"},{name:"AEDT",value:"11"},{name:"AEST",value:"10"},{name:"AFT",value:"4:30"},{name:"AKDT",value:"-8"},{name:"AKST",value:"-9"},{name:"ALMT",value:"6"},{name:"AMST",value:"5"},{name:"AMST",value:"-3"},{name:"AMT",value:"4"},{name:"AMT",value:"-4"},{name:"ANAST",value:"12"},{name:"ANAT",value:"12"},{name:"AQTT",value:"5"},{name:"ART",value:"-3"},{name:"AST",value:"3"},{name:"AST",value:"-4"},{name:"AWDT",value:"9"},{name:"AWST",value:"8"},{name:"AZOST",value:"0"},{name:"AZOT",value:"-1"},{name:"AZST",value:"5"},{name:"AZT",value:"4"},{name:"B",value:"2"},{name:"BNT",value:"8"},{name:"BOT",value:"-4"},{name:"BRST",value:"-2"},{name:"BRT",value:"-3"},{name:"BST",value:"6"},{name:"BST",value:"1"},{name:"BTT",value:"6"},{name:"C",value:"3"},{name:"CAST",value:"8"},{name:"CAT",value:"2"},{name:"CCT",value:"6:30"},{name:"CDT",value:"-4"},{name:"CDT",value:"-5"},{name:"CEST",value:"2"},{name:"CET",value:"1"},{name:"CHADT",value:"13:45"},{name:"CHAST",value:"12:45"},{name:"CKT",value:"-10"},{name:"CLST",value:"-3"},{name:"CLT",value:"-4"},{name:"COT",value:"-5"},{name:"CST",value:"8"},{name:"CST",value:"-6"},{name:"CST",value:"-5"},{name:"CVT",value:"-1"},{name:"CXT",value:"7"},{name:"ChST",value:"10"},{name:"D",value:"4"},{name:"DAVT",value:"7"},{name:"E",value:"5"},{name:"EASST",value:"-5"},{name:"EAST",value:"-6"},{name:"EAT",value:"3"},{name:"EAT",value:"3"},{name:"ECT",value:"-5"},{name:"EDT",value:"-4"},{name:"EEST",value:"3"},{name:"EET",value:"2"},{name:"EGST",value:"0"},{name:"EGT",value:"-1"},{name:"EST",value:"-5"},{name:"ET",value:"-5"},{name:"F",value:"6"},{name:"FJST",value:"13"},{name:"FJT",value:"12"},{name:"FKST",value:"-3"},{name:"FKT",value:"-4"},{name:"FNT",value:"-2"},{name:"G",value:"7"},{name:"GALT",value:"-6"},{name:"GAMT",value:"-9"},{name:"GET",value:"4"},{name:"GFT",value:"-3"},{name:"GILT",value:"12"},{name:"GMT",value:"0"},{name:"GST",value:"4"},{name:"GYT",value:"-4"},{name:"H",value:"8"},{name:"HAA",value:"-3"},{name:"HAC",value:"-5"},{name:"HADT",value:"-9"},{name:"HAE",value:"-4"},{name:"HAP",value:"-7"},{name:"HAR",value:"-6"},{name:"HAST",value:"-10"},{name:"HAT",value:"-2:30"},{name:"HAY",value:"-8"},{name:"HKT",value:"8"},{name:"HLV",value:"-4:30"},{name:"HNA",value:"-4"},{name:"HNC",value:"-6"},{name:"HNE",value:"-5"},{name:"HNP",value:"-8"},{name:"HNR",value:"-7"},{name:"HNT",value:"-3:30"},{name:"HNY",value:"-9"},{name:"HOVT",value:"7"},{name:"I",value:"9"},{name:"ICT",value:"7"},{name:"IDT",value:"3"},{name:"IOT",value:"6"},{name:"IRDT",value:"4:30"},{name:"IRKST",value:"9"},{name:"IRKT",value:"9"},{name:"IRST",value:"3:30"},{name:"IST",value:"2"},{name:"IST",value:"5:30"},{name:"IST",value:"1"},{name:"JST",value:"9"},{name:"K",value:"10"},{name:"KGT",value:"6"},{name:"KRAST",value:"8"},{name:"KRAT",value:"8"},{name:"KST",value:"9"},{name:"KUYT",value:"4"},{name:"L",value:"11"},{name:"LHDT",value:"11"},{name:"LHST",value:"10:30"},{name:"LINT",value:"14"},{name:"M",value:"12"},{name:"MAGST",value:"12"},{name:"MAGT",value:"12"},{name:"MART",value:"-9:30"},{name:"MAWT",value:"5"},{name:"MDT",value:"-6"},{name:"MESZ",value:"2"},{name:"MEZ",value:"1"},{name:"MHT",value:"12"},{name:"MMT",value:"6:30"},{name:"MSD",value:"4"},{name:"MSK",value:"4"},{name:"MST",value:"-7"},{name:"MUT",value:"4"},{name:"MVT",value:"5"},{name:"MYT",value:"8"},{name:"N",value:"-1"},{name:"NCT",value:"11"},{name:"NDT",value:"-2:30"},{name:"NFT",value:"11:30"},{name:"NOVST",value:"7"},{name:"NOVT",value:"6"},{name:"NPT",value:"5:45"},{name:"NST",value:"-3:30"},{name:"NUT",value:"-11"},{name:"NZDT",value:"13"},{name:"NZST",value:"12"},{name:"O",value:"-2"},{name:"OMSST",value:"7"},{name:"OMST",value:"7"},{name:"P",value:"-3"},{name:"PDT",value:"-7"},{name:"PET",value:"-5"},{name:"PETST",value:"12"},{name:"PETT",value:"12"},{name:"PGT",value:"10"},{name:"PHOT",value:"13"},{name:"PHT",value:"8"},{name:"PKT",value:"5"},{name:"PMDT",value:"-2"},{name:"PMST",value:"-3"},{name:"PONT",value:"11"},{name:"PST",value:"-8"},{name:"PST",value:"-8"},{name:"PT",value:"-8"},{name:"PWT",value:"9"},{name:"PYST",value:"-3"},{name:"PYT",value:"-4"},{name:"Q",value:"-4"},{name:"R",value:"-5"},{name:"RET",value:"4"},{name:"S",value:"-6"},{name:"SAMT",value:"4"},{name:"SAST",value:"2"},{name:"SBT",value:"11"},{name:"SCT",value:"4"},{name:"SGT",value:"8"},{name:"SRT",value:"-3"},{name:"SST",value:"-11"},{name:"T",value:"-7"},{name:"TAHT",value:"-10"},{name:"TFT",value:"5"},{name:"TJT",value:"5"},{name:"TKT",value:"13"},{name:"TLT",value:"9"},{name:"TMT",value:"5"},{name:"TVT",value:"12"},{name:"U",value:"-8"},{name:"ULAT",value:"8"},{name:"UTC",value:"0"},{name:"UYST",value:"-2"},{name:"UYT",value:"-3"},{name:"UZT",value:"5"},{name:"V",value:"-9"},{name:"VET",value:"-4:30"},{name:"VLAST",value:"11"},{name:"VLAT",value:"11"},{name:"VUT",value:"11"},{name:"W",value:"-10"},{name:"WAST",value:"2"},{name:"WAT",value:"1"},{name:"WEST",value:"1"},{name:"WESZ",value:"1"},{name:"WET",value:"0"},{name:"WEZ",value:"0"},{name:"WFT",value:"12"},{name:"WGST",value:"-2"},{name:"WGT",value:"-3"},{name:"WIB",value:"7"},{name:"WIT",value:"9"},{name:"WITA",value:"8"},{name:"WST",value:"1"},{name:"WST",value:"13"},{name:"WT",value:"0"},{name:"X",value:"-11"},{name:"Y",value:"-12"},{name:"YAKST",value:"10"},{name:"YAKT",value:"10"},{name:"YAPT",value:"10"},{name:"YEKST",value:"6"},{name:"YEKT",value:"6"},{name:"Z",value:"0"}],e.ago=h,e.date=function(e){var a="string"==typeof e?u.parseISO(e):e;return u.isValid(a)||(a=null),a},e.duration=c,e.format=d,e.getFormatString=m,e.granularDuration=function(e,a){return void 0===a&&(a={}),a.seconds=void 0!==a.seconds&&a.seconds,a.months=void 0!==a.months&&a.months,a.years=void 0!==a.years&&a.years,a.precision=void 0===a.precision?3:a.precision,c(e,a)},e.iso8601=function(e){return(e=v(e))?u.format(e,"yyyy-MM-dd'T'HH:mm:ssxxx"):""},e.parse=v,e.parseDuration=p,e.parseLocal=function(e){return"string"==typeof e&&(e=l.utcToZonedTime(e,null)),u.isValid(e)?e:null},e.range=y,e.simpleFormat=function(e){return u.format(e,"yyyy-MM-dd'T'HH:mm:ssxxxxx")},e.toUTC=function(e){var a=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(a)},e.ɵa=C,e.ɵb=E,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=firestitch-date.umd.min.js.map |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -32,2 +32,6 @@ /** | ||
let toFormat = getFormatString(format); | ||
if (formatParts.indexOf('yearless') !== -1) { | ||
fromFormat = fromFormat.replace(' yyyy', ''); | ||
toFormat = toFormat.replace(' yyyy', ''); | ||
} | ||
if (differenceInMilliseconds(from, to) == 0) { | ||
@@ -38,8 +42,19 @@ return fnsFormat(from, fromFormat); | ||
// date and time | ||
if (from.getFullYear() == to.getFullYear()) { | ||
toFormat = toFormat | ||
.replace(' yyyy', '') | ||
.replace(',', ''); | ||
if (!from.getMinutes()) { | ||
fromFormat = fromFormat.replace(':mm', ''); | ||
} | ||
if (!to.getMinutes()) { | ||
toFormat = toFormat.replace(':mm', ''); | ||
} | ||
if (from.getFullYear() === to.getFullYear()) { | ||
if ((new Date()).getFullYear() === from.getFullYear()) { | ||
fromFormat = fromFormat.replace(', yyyy', ''); | ||
} | ||
toFormat = toFormat.replace(', yyyy', ''); | ||
if (from.getMonth() == to.getMonth()) { | ||
if (from.getDate() == to.getDate()) { | ||
if ((from.getHours() <= 12 && to.getHours() <= 12) || | ||
(from.getHours() >= 12 && to.getHours() >= 12)) { | ||
fromFormat = fromFormat.replace(' aaa', ''); | ||
} | ||
toFormat = toFormat | ||
@@ -84,3 +99,3 @@ .replace('MMMM', '') | ||
if (from.getDate() == to.getDate()) { | ||
if (formatParts.indexOf('time') == -1) { | ||
if (formatParts.indexOf('time') === -1) { | ||
fromFormat = getFormatString(format); | ||
@@ -96,6 +111,6 @@ toFormat = ''; | ||
if (toFormat) { | ||
output += ' - ' + fnsFormat(to, toFormat); | ||
output += ' – ' + fnsFormat(to, toFormat); | ||
} | ||
return output; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZ2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AZmlyZXN0aXRjaC9kYXRlLyIsInNvdXJjZXMiOlsibGlicy9yYW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLE1BQU0sSUFBSSxTQUFTLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFDekUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxTQUFTLENBQUM7Ozs7Ozs7QU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AgICAgLnJlcGxhY2UoJyB5eXl5JywgJycpXG4gICAgICAgICAgLnJlcGxhY2UoJywnLCAnJyk7XG5cbiAgICAgICAgaWYgKGZyb20uZ2V0TW9udGgoKSA9PSB0by5nZXRNb250aCgpKSB7XG4gICAgICAgICAgaWYgKGZyb20uZ2V0RGF0ZSgpID09IHRvLmdldERhdGUoKSkge1xuICAgICAgICAgICAgdG9Gb3JtYXQgPSB0b0Zvcm1hdFxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCdNTU1NJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJ01NTScsICcnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCdFRUVFJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJ0VFRScsICcnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCcgZG8nLCAnJylcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnIGQnLCAnJylcbiAgICAgICAgICAgICAgICAudHJpbSgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBhZGQgY29tbWEgYWZ0ZXIgZGF5XG4gICAgICAgICAgICB0b0Zvcm1hdCA9IHRvRm9ybWF0XG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJyBkbycsICcgZG8sJylcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnIGQnLCAnIGQsJyk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGFkZCBjb21tYSBhZnRlciBkYXlcbiAgICAgICAgICB0b0Zvcm1hdCA9IHRvRm9ybWF0XG4gICAgICAgICAgICAgIC5yZXBsYWNlKCcgZG8nLCAnIGRvLCcpXG4gICAgICAgICAgICAgIC5yZXBsYWNlKCcgZCcsICcgZCwnKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAvLyBkYXRlIG9ubHlcbiAgICAgIGlmIChmcm9tLmdldEZ1bGxZZWFyKCkgPT0gdG8uZ2V0RnVsbFllYXIoKSkge1xuICAgICAgICBmcm9tRm9ybWF0ID0gZnJvbUZvcm1hdFxuICAgICAgICAgIC5yZXBsYWNlKCcgeXl5eScsICcnKVxuICAgICAgICAgIC5yZXBsYWNlKCcsJywgJycpXG4gICAgICAgICAgLnRyaW0oKTtcblxuICAgICAgICBpZiAoZnJvbS5nZXRNb250aCgpID09IHRvLmdldE1vbnRoKCkpIHtcblxuICAgICAgICAgIGlmIChmb3JtYXRQYXJ0cy5pbmRleE9mKCdkYXknKSA9PSAtMSkge1xuICAgICAgICAgICAgdG9Gb3JtYXQgPSB0b0Zvcm1hdFxuICAgICAgICAgICAgICAucmVwbGFjZSgnTU1NTScsICcnKVxuICAgICAgICAgICAgICAucmVwbGFjZSgnTU1NJywgJycpXG4gICAgICAgICAgICAgIC50cmltKCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGZyb20uZ2V0RGF0ZSgpID09IHRvLmdldERhdGUoKSkge1xuICAgICAgICAgICAgaWYgKGZvcm1hdFBhcnRzLmluZGV4T2YoJ3RpbWUnKSA9PSAtMSkge1xuICAgICAgICAgICAgICBmcm9tRm9ybWF0ID0gZ2V0Rm9ybWF0U3RyaW5nKGZvcm1hdCk7XG4gICAgICAgICAgICAgIHRvRm9ybWF0ID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgbGV0IG91dHB1dCA9IGZuc0Zvcm1hdChmcm9tLCBmcm9tRm9ybWF0KTtcbiAgICBpZiAodG9Gb3JtYXQpIHtcbiAgICAgIG91dHB1dCArPSAnIC0gJyArIGZuc0Zvcm1hdCh0bywgdG9Gb3JtYXQpO1xuICAgIH1cblxuICAgIHJldHVybiBvdXRwdXQ7XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZ2UuanMiLCJzb3VyY2V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7XG5cbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgKGZyb20uZ2V0SG91cnMoKSA8PSAxMiAmJiB0by5nZXRIb3VycygpIDw9IDEyKSB8fFxuICAgICAgICAgICAgICAoZnJvbS5nZXRIb3VycygpID49IDEyICYmIHRvLmdldEhvdXJzKCkgPj0gMTIpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgZnJvbUZvcm1hdCA9IGZyb21Gb3JtYXQucmVwbGFjZSgnIGFhYScsICcnKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdG9Gb3JtYXQgPSB0b0Zvcm1hdFxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCdNTU1NJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJ01NTScsICcnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCdFRUVFJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJ0VFRScsICcnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCcgZG8nLCAnJylcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnIGQnLCAnJylcbiAgICAgICAgICAgICAgICAudHJpbSgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBhZGQgY29tbWEgYWZ0ZXIgZGF5XG4gICAgICAgICAgICB0b0Zvcm1hdCA9IHRvRm9ybWF0XG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJyBkbycsICcgZG8sJylcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnIGQnLCAnIGQsJyk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIGFkZCBjb21tYSBhZnRlciBkYXlcbiAgICAgICAgICB0b0Zvcm1hdCA9IHRvRm9ybWF0XG4gICAgICAgICAgICAgIC5yZXBsYWNlKCcgZG8nLCAnIGRvLCcpXG4gICAgICAgICAgICAgIC5yZXBsYWNlKCcgZCcsICcgZCwnKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAvLyBkYXRlIG9ubHlcbiAgICAgIGlmIChmcm9tLmdldEZ1bGxZZWFyKCkgPT0gdG8uZ2V0RnVsbFllYXIoKSkge1xuICAgICAgICBmcm9tRm9ybWF0ID0gZnJvbUZvcm1hdFxuICAgICAgICAgIC5yZXBsYWNlKCcgeXl5eScsICcnKVxuICAgICAgICAgIC5yZXBsYWNlKCcsJywgJycpXG4gICAgICAgICAgLnRyaW0oKTtcblxuICAgICAgICBpZiAoZnJvbS5nZXRNb250aCgpID09IHRvLmdldE1vbnRoKCkpIHtcblxuICAgICAgICAgIGlmIChmb3JtYXRQYXJ0cy5pbmRleE9mKCdkYXknKSA9PSAtMSkge1xuICAgICAgICAgICAgdG9Gb3JtYXQgPSB0b0Zvcm1hdFxuICAgICAgICAgICAgICAucmVwbGFjZSgnTU1NTScsICcnKVxuICAgICAgICAgICAgICAucmVwbGFjZSgnTU1NJywgJycpXG4gICAgICAgICAgICAgIC50cmltKCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGZyb20uZ2V0RGF0ZSgpID09IHRvLmdldERhdGUoKSkge1xuICAgICAgICAgICAgaWYgKGZvcm1hdFBhcnRzLmluZGV4T2YoJ3RpbWUnKSA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgZnJvbUZvcm1hdCA9IGdldEZvcm1hdFN0cmluZyhmb3JtYXQpO1xuICAgICAgICAgICAgICB0b0Zvcm1hdCA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGxldCBvdXRwdXQgPSBmbnNGb3JtYXQoZnJvbSwgZnJvbUZvcm1hdCk7XG4gICAgaWYgKHRvRm9ybWF0KSB7XG4gICAgICBvdXRwdXQgKz0gJyDigJMgJyArIGZuc0Zvcm1hdCh0bywgdG9Gb3JtYXQpO1xuICAgIH1cblxuICAgIHJldHVybiBvdXRwdXQ7XG59XG4iXX0= |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -33,2 +33,6 @@ /** | ||
var toFormat = getFormatString(format); | ||
if (formatParts.indexOf('yearless') !== -1) { | ||
fromFormat = fromFormat.replace(' yyyy', ''); | ||
toFormat = toFormat.replace(' yyyy', ''); | ||
} | ||
if (differenceInMilliseconds(from, to) == 0) { | ||
@@ -39,8 +43,19 @@ return fnsFormat(from, fromFormat); | ||
// date and time | ||
if (from.getFullYear() == to.getFullYear()) { | ||
toFormat = toFormat | ||
.replace(' yyyy', '') | ||
.replace(',', ''); | ||
if (!from.getMinutes()) { | ||
fromFormat = fromFormat.replace(':mm', ''); | ||
} | ||
if (!to.getMinutes()) { | ||
toFormat = toFormat.replace(':mm', ''); | ||
} | ||
if (from.getFullYear() === to.getFullYear()) { | ||
if ((new Date()).getFullYear() === from.getFullYear()) { | ||
fromFormat = fromFormat.replace(', yyyy', ''); | ||
} | ||
toFormat = toFormat.replace(', yyyy', ''); | ||
if (from.getMonth() == to.getMonth()) { | ||
if (from.getDate() == to.getDate()) { | ||
if ((from.getHours() <= 12 && to.getHours() <= 12) || | ||
(from.getHours() >= 12 && to.getHours() >= 12)) { | ||
fromFormat = fromFormat.replace(' aaa', ''); | ||
} | ||
toFormat = toFormat | ||
@@ -85,3 +100,3 @@ .replace('MMMM', '') | ||
if (from.getDate() == to.getDate()) { | ||
if (formatParts.indexOf('time') == -1) { | ||
if (formatParts.indexOf('time') === -1) { | ||
fromFormat = getFormatString(format); | ||
@@ -97,6 +112,6 @@ toFormat = ''; | ||
if (toFormat) { | ||
output += ' - ' + fnsFormat(to, toFormat); | ||
output += ' – ' + fnsFormat(to, toFormat); | ||
} | ||
return output; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZ2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AZmlyZXN0aXRjaC9kYXRlLyIsInNvdXJjZXMiOlsibGlicy9yYW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLE1BQU0sSUFBSSxTQUFTLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFDekUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxTQUFTLENBQUM7Ozs7Ozs7QUFHaEMsTUFBTSxVQUFVLEtBQUssQ0FBQyxJQUFVLEVBQUUsRUFBUSxFQUFFLE1BQWU7SUFBZix1QkFBQSxFQUFBLGVBQWU7SUFFdkQsSUFBSSxHQUFHLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNuQixFQUFFLEdBQUcsS0FBSyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBRWYsSUFBSSxDQUFDLEVBQUUsSUFBSSxDQUFDLElBQUksRUFBRTtRQUNoQixPQUFPLEVBQUUsQ0F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gICAgICAgICAgICAucmVwbGFjZSgnTU1NJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJ0VFRUUnLCAnJylcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnRUVFJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJyBkbycsICcnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCcgZCcsICcnKVxuICAgICAgICAgICAgICAgIC50cmltKCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIGFkZCBjb21tYSBhZnRlciBkYXlcbiAgICAgICAgICAgIHRvRm9ybWF0ID0gdG9Gb3JtYXRcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnIGRvJywgJyBkbywnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCcgZCcsICcgZCwnKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gYWRkIGNvbW1hIGFmdGVyIGRheVxuICAgICAgICAgIHRvRm9ybWF0ID0gdG9Gb3JtYXRcbiAgICAgICAgICAgICAgLnJlcGxhY2UoJyBkbycsICcgZG8sJylcbiAgICAgICAgICAgICAgLnJlcGxhY2UoJyBkJywgJyBkLCcpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIC8vIGRhdGUgb25seVxuICAgICAgaWYgKGZyb20uZ2V0RnVsbFllYXIoKSA9PSB0by5nZXRGdWxsWWVhcigpKSB7XG4gICAgICAgIGZyb21Gb3JtYXQgPSBmcm9tRm9ybWF0XG4gICAgICAgICAgLnJlcGxhY2UoJyB5eXl5JywgJycpXG4gICAgICAgICAgLnJlcGxhY2UoJywnLCAnJylcbiAgICAgICAgICAudHJpbSgpO1xuXG4gICAgICAgIGlmIChmcm9tLmdldE1vbnRoKCkgPT0gdG8uZ2V0TW9udGgoKSkge1xuXG4gICAgICAgICAgaWYgKGZvcm1hdFBhcnRzLmluZGV4T2YoJ2RheScpID09IC0xKSB7XG4gICAgICAgICAgICB0b0Zvcm1hdCA9IHRvRm9ybWF0XG4gICAgICAgICAgICAgIC5yZXBsYWNlKCdNTU1NJywgJycpXG4gICAgICAgICAgICAgIC5yZXBsYWNlKCdNTU0nLCAnJylcbiAgICAgICAgICAgICAgLnRyaW0oKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZnJvbS5nZXREYXRlKCkgPT0gdG8uZ2V0RGF0ZSgpKSB7XG4gICAgICAgICAgICBpZiAoZm9ybWF0UGFydHMuaW5kZXhPZigndGltZScpID09IC0xKSB7XG4gICAgICAgICAgICAgIGZyb21Gb3JtYXQgPSBnZXRGb3JtYXRTdHJpbmcoZm9ybWF0KTtcbiAgICAgICAgICAgICAgdG9Gb3JtYXQgPSAnJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICBsZXQgb3V0cHV0ID0gZm5zRm9ybWF0KGZyb20sIGZyb21Gb3JtYXQpO1xuICAgIGlmICh0b0Zvcm1hdCkge1xuICAgICAgb3V0cHV0ICs9ICcgLSAnICsgZm5zRm9ybWF0KHRvLCB0b0Zvcm1hdCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIG91dHB1dDtcbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZ2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AZmlyZXN0aXRjaC9kYXRlLyIsInNvdXJjZXMiOlsibGlicy9yYW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLE1BQU0sSUFBSSxTQUFTLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFDekUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxLQUFLLE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uICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0b0Zvcm1hdCA9IHRvRm9ybWF0XG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJ01NTU0nLCAnJylcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnTU1NJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJ0VFRUUnLCAnJylcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnRUVFJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJyBkbycsICcnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCcgZCcsICcnKVxuICAgICAgICAgICAgICAgIC50cmltKCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIGFkZCBjb21tYSBhZnRlciBkYXlcbiAgICAgICAgICAgIHRvRm9ybWF0ID0gdG9Gb3JtYXRcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgnIGRvJywgJyBkbywnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCcgZCcsICcgZCwnKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gYWRkIGNvbW1hIGFmdGVyIGRheVxuICAgICAgICAgIHRvRm9ybWF0ID0gdG9Gb3JtYXRcbiAgICAgICAgICAgICAgLnJlcGxhY2UoJyBkbycsICcgZG8sJylcbiAgICAgICAgICAgICAgLnJlcGxhY2UoJyBkJywgJyBkLCcpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIC8vIGRhdGUgb25seVxuICAgICAgaWYgKGZyb20uZ2V0RnVsbFllYXIoKSA9PSB0by5nZXRGdWxsWWVhcigpKSB7XG4gICAgICAgIGZyb21Gb3JtYXQgPSBmcm9tRm9ybWF0XG4gICAgICAgICAgLnJlcGxhY2UoJyB5eXl5JywgJycpXG4gICAgICAgICAgLnJlcGxhY2UoJywnLCAnJylcbiAgICAgICAgICAudHJpbSgpO1xuXG4gICAgICAgIGlmIChmcm9tLmdldE1vbnRoKCkgPT0gdG8uZ2V0TW9udGgoKSkge1xuXG4gICAgICAgICAgaWYgKGZvcm1hdFBhcnRzLmluZGV4T2YoJ2RheScpID09IC0xKSB7XG4gICAgICAgICAgICB0b0Zvcm1hdCA9IHRvRm9ybWF0XG4gICAgICAgICAgICAgIC5yZXBsYWNlKCdNTU1NJywgJycpXG4gICAgICAgICAgICAgIC5yZXBsYWNlKCdNTU0nLCAnJylcbiAgICAgICAgICAgICAgLnRyaW0oKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZnJvbS5nZXREYXRlKCkgPT0gdG8uZ2V0RGF0ZSgpKSB7XG4gICAgICAgICAgICBpZiAoZm9ybWF0UGFydHMuaW5kZXhPZigndGltZScpID09PSAtMSkge1xuICAgICAgICAgICAgICBmcm9tRm9ybWF0ID0gZ2V0Rm9ybWF0U3RyaW5nKGZvcm1hdCk7XG4gICAgICAgICAgICAgIHRvRm9ybWF0ID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4gICAgbGV0IG91dHB1dCA9IGZuc0Zvcm1hdChmcm9tLCBmcm9tRm9ybWF0KTtcbiAgICBpZiAodG9Gb3JtYXQpIHtcbiAgICAgIG91dHB1dCArPSAnIOKAkyAnICsgZm5zRm9ybWF0KHRvLCB0b0Zvcm1hdCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIG91dHB1dDtcbn1cbiJdfQ== |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -474,2 +474,6 @@ import { Pipe, Component, ChangeDetectionStrategy, ElementRef, Input, Injectable, Inject, ComponentFactoryResolver, Directive, Renderer2, ViewContainerRef, NgModule } from '@angular/core'; | ||
let toFormat = getFormatString(format); | ||
if (formatParts.indexOf('yearless') !== -1) { | ||
fromFormat = fromFormat.replace(' yyyy', ''); | ||
toFormat = toFormat.replace(' yyyy', ''); | ||
} | ||
if (differenceInMilliseconds(from, to) == 0) { | ||
@@ -480,8 +484,19 @@ return format$1(from, fromFormat); | ||
// date and time | ||
if (from.getFullYear() == to.getFullYear()) { | ||
toFormat = toFormat | ||
.replace(' yyyy', '') | ||
.replace(',', ''); | ||
if (!from.getMinutes()) { | ||
fromFormat = fromFormat.replace(':mm', ''); | ||
} | ||
if (!to.getMinutes()) { | ||
toFormat = toFormat.replace(':mm', ''); | ||
} | ||
if (from.getFullYear() === to.getFullYear()) { | ||
if ((new Date()).getFullYear() === from.getFullYear()) { | ||
fromFormat = fromFormat.replace(', yyyy', ''); | ||
} | ||
toFormat = toFormat.replace(', yyyy', ''); | ||
if (from.getMonth() == to.getMonth()) { | ||
if (from.getDate() == to.getDate()) { | ||
if ((from.getHours() <= 12 && to.getHours() <= 12) || | ||
(from.getHours() >= 12 && to.getHours() >= 12)) { | ||
fromFormat = fromFormat.replace(' aaa', ''); | ||
} | ||
toFormat = toFormat | ||
@@ -526,3 +541,3 @@ .replace('MMMM', '') | ||
if (from.getDate() == to.getDate()) { | ||
if (formatParts.indexOf('time') == -1) { | ||
if (formatParts.indexOf('time') === -1) { | ||
fromFormat = getFormatString(format); | ||
@@ -538,3 +553,3 @@ toFormat = ''; | ||
if (toFormat) { | ||
output += ' - ' + format$1(to, toFormat); | ||
output += ' – ' + format$1(to, toFormat); | ||
} | ||
@@ -541,0 +556,0 @@ return output; |
@@ -479,2 +479,6 @@ import { Pipe, Component, ChangeDetectionStrategy, ElementRef, Input, Injectable, Inject, ComponentFactoryResolver, Directive, Renderer2, ViewContainerRef, NgModule } from '@angular/core'; | ||
var toFormat = getFormatString(format); | ||
if (formatParts.indexOf('yearless') !== -1) { | ||
fromFormat = fromFormat.replace(' yyyy', ''); | ||
toFormat = toFormat.replace(' yyyy', ''); | ||
} | ||
if (differenceInMilliseconds(from, to) == 0) { | ||
@@ -485,8 +489,19 @@ return format$1(from, fromFormat); | ||
// date and time | ||
if (from.getFullYear() == to.getFullYear()) { | ||
toFormat = toFormat | ||
.replace(' yyyy', '') | ||
.replace(',', ''); | ||
if (!from.getMinutes()) { | ||
fromFormat = fromFormat.replace(':mm', ''); | ||
} | ||
if (!to.getMinutes()) { | ||
toFormat = toFormat.replace(':mm', ''); | ||
} | ||
if (from.getFullYear() === to.getFullYear()) { | ||
if ((new Date()).getFullYear() === from.getFullYear()) { | ||
fromFormat = fromFormat.replace(', yyyy', ''); | ||
} | ||
toFormat = toFormat.replace(', yyyy', ''); | ||
if (from.getMonth() == to.getMonth()) { | ||
if (from.getDate() == to.getDate()) { | ||
if ((from.getHours() <= 12 && to.getHours() <= 12) || | ||
(from.getHours() >= 12 && to.getHours() >= 12)) { | ||
fromFormat = fromFormat.replace(' aaa', ''); | ||
} | ||
toFormat = toFormat | ||
@@ -531,3 +546,3 @@ .replace('MMMM', '') | ||
if (from.getDate() == to.getDate()) { | ||
if (formatParts.indexOf('time') == -1) { | ||
if (formatParts.indexOf('time') === -1) { | ||
fromFormat = getFormatString(format); | ||
@@ -543,3 +558,3 @@ toFormat = ''; | ||
if (toFormat) { | ||
output += ' - ' + format$1(to, toFormat); | ||
output += ' – ' + format$1(to, toFormat); | ||
} | ||
@@ -546,0 +561,0 @@ return output; |
@@ -0,0 +0,0 @@ /** |
export declare function ago(date: any, frmt?: string): string; |
export declare function date(value: any): any; |
export declare function duration(time: any, options?: any): string; |
export declare function format(date: any, formatTo?: string): string; |
export declare function getFormatString(formatTo?: string): string; |
export declare function granularDuration(time: any, options?: {}): string; |
@@ -0,0 +0,0 @@ export * from './ago'; |
export declare function iso8601(date: any): string; |
import { Observable } from 'rxjs'; | ||
export declare function parseDuration(value: string): Observable<Object>; |
export declare function parseLocal(date: any): Date; |
export declare function parse(date: any): Date; |
export declare function range(from: Date, to: Date, format?: string): string; |
export declare function simpleFormat(date: any): string; |
export declare function toUTC(date: Date): Date; |
{ | ||
"name": "@firestitch/date", | ||
"version": "8.0.15", | ||
"version": "8.0.16", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -0,0 +0,0 @@ export { FsDateModule } from './app/fs-date.module'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
773042
7272