From 7b11c29a6f455c5b07952bbee48d593e2e8a86f2 Mon Sep 17 00:00:00 2001 From: Isaac Cambron Date: Tue, 23 Jul 2019 14:29:02 -0400 Subject: [PATCH] bump to 1.3.0 --- bower.json | 2 +- component.json | 2 +- dist/twix.js | 9 ++++++--- dist/twix.min.js | 2 +- package.js | 2 +- package.json | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bower.json b/bower.json index ff75b5c..0cbdd12 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "twix", - "version": "1.2.1", + "version": "1.3.0", "dependencies": { "moment": "*" }, diff --git a/component.json b/component.json index 5e85eca..1ce3a81 100644 --- a/component.json +++ b/component.json @@ -1,6 +1,6 @@ { "name": "twix", - "version": "1.2.1", + "version": "1.3.0", "dependencies": { "moment/moment": "*" }, diff --git a/dist/twix.js b/dist/twix.js index 6a1e110..fc94a11 100644 --- a/dist/twix.js +++ b/dist/twix.js @@ -366,7 +366,10 @@ options = { groupMeridiems: true, spaceBeforeMeridiem: true, + spaceBeforeMonth: true, + spaceBeforeDay: true, showDayOfWeek: false, + showYearFirst: false, hideTime: false, hideYear: false, implicitMinutes: true, @@ -409,7 +412,7 @@ return date.format(options.yearFormat); }, pre: americanish ? ', ' : ' ', - slot: 4 + slot: options.showYearFirst ? -1 : 4 }); } if (atomicMonthDate && needDate) { @@ -433,7 +436,7 @@ fn: function(date) { return date.format(options.monthFormat); }, - pre: ' ', + pre: options.spaceBeforeMonth ? ' ' : '', slot: americanish ? 2 : 3 }); } @@ -443,7 +446,7 @@ fn: function(date) { return date.format(options.dayFormat); }, - pre: ' ', + pre: options.spaceBeforeDay ? ' ' : '', slot: americanish ? 3 : 2 }); } diff --git a/dist/twix.min.js b/dist/twix.min.js index a3d2a6c..11b0b67 100644 --- a/dist/twix.min.js +++ b/dist/twix.min.js @@ -1 +1 @@ -(function(){var hasModule,isArray,makeTwix,slice=[].slice;hasModule=typeof module!=="undefined"&&module!==null&&module.exports!=null&&typeof require==="function";isArray=function(input){return Object.prototype.toString.call(input)==="[object Array]"};makeTwix=function(moment){var Twix;if(moment==null){throw new Error("Can't find moment")}Twix=function(){function Twix(start,end,parseFormat,options){var ref;if(options==null){options={}}if(typeof parseFormat!=="string"){options=parseFormat!=null?parseFormat:{};parseFormat=null}if(typeof options==="boolean"){options={allDay:options}}this._oStart=moment(start,parseFormat,options.parseStrict);this._oEnd=moment(end,parseFormat,options.parseStrict);this.allDay=(ref=options.allDay)!=null?ref:false;this._mutated()}Twix._extend=function(){var attr,first,j,len,other,others;first=arguments[0],others=2<=arguments.length?slice.call(arguments,1):[];for(j=0,len=others.length;j=end){return 0}return end.diff(start,period)};Twix.prototype.iterate=function(intervalAmount,period,minHours){var end,hasNext,ref,start;ref=this._prepIterateInputs(intervalAmount,period,minHours),intervalAmount=ref[0],period=ref[1],minHours=ref[2];start=this.start().startOf(period);end=this.end().startOf(period);if(this.allDay){end=end.add(1,"d")}hasNext=function(_this){return function(){return!_this.allDay&&start<=end&&(!minHours||!start.isSame(end)||_this._end.hours()>minHours)||_this.allDay&&startmoment()};Twix.prototype.isCurrent=function(){return!this.isPast()&&!this.isFuture()};Twix.prototype.contains=function(mom){if(!moment.isMoment(mom)){mom=moment(mom)}return this._start<=mom&&this._lastMilli>=mom};Twix.prototype.isEmpty=function(){return this._start.isSame(this._displayEnd)};Twix.prototype.overlaps=function(other){return this._displayEnd.isAfter(other._start)&&this._start.isBefore(other._displayEnd)};Twix.prototype.engulfs=function(other){return this._start<=other._start&&this._displayEnd>=other._displayEnd};Twix.prototype.union=function(other){var allDay,newEnd,newStart;allDay=this.allDay&&other.allDay;newStart=this._startother._lastMilli?allDay?this._end:this._displayEnd:allDay?other._end:other._displayEnd;return new Twix(newStart,newEnd,allDay)};Twix.prototype.intersection=function(other){var allDay,newEnd,newStart;allDay=this.allDay&&other.allDay;newStart=this._start>other._start?this._start:other._start;newEnd=this._lastMilli=start){results1.push(mom)}}return results1}().sort(function(a,b){return a.valueOf()-b.valueOf()})}if(dur&&dur.asMilliseconds()===0||times&×.length===0){return[this]}vals=[];i=0;final=this._displayEnd;while(start0&&!this.allDay&&this.end().startOf("d").valueOf()===this.start().add(1,"d").startOf("d").valueOf()&&this._start.hours()>12&&this._end.hours()start.clone().startOf(period)){start.startOf(period).add(intervalAmount,period)}if(end=end){return 0}return end.diff(start,period)};Twix.prototype.iterate=function(intervalAmount,period,minHours){var end,hasNext,ref,start;ref=this._prepIterateInputs(intervalAmount,period,minHours),intervalAmount=ref[0],period=ref[1],minHours=ref[2];start=this.start().startOf(period);end=this.end().startOf(period);if(this.allDay){end=end.add(1,"d")}hasNext=function(_this){return function(){return!_this.allDay&&start<=end&&(!minHours||!start.isSame(end)||_this._end.hours()>minHours)||_this.allDay&&startmoment()};Twix.prototype.isCurrent=function(){return!this.isPast()&&!this.isFuture()};Twix.prototype.contains=function(mom){if(!moment.isMoment(mom)){mom=moment(mom)}return this._start<=mom&&this._lastMilli>=mom};Twix.prototype.isEmpty=function(){return this._start.isSame(this._displayEnd)};Twix.prototype.overlaps=function(other){return this._displayEnd.isAfter(other._start)&&this._start.isBefore(other._displayEnd)};Twix.prototype.engulfs=function(other){return this._start<=other._start&&this._displayEnd>=other._displayEnd};Twix.prototype.union=function(other){var allDay,newEnd,newStart;allDay=this.allDay&&other.allDay;newStart=this._startother._lastMilli?allDay?this._end:this._displayEnd:allDay?other._end:other._displayEnd;return new Twix(newStart,newEnd,allDay)};Twix.prototype.intersection=function(other){var allDay,newEnd,newStart;allDay=this.allDay&&other.allDay;newStart=this._start>other._start?this._start:other._start;newEnd=this._lastMilli=start){results1.push(mom)}}return results1}().sort(function(a,b){return a.valueOf()-b.valueOf()})}if(dur&&dur.asMilliseconds()===0||times&×.length===0){return[this]}vals=[];i=0;final=this._displayEnd;while(start0&&!this.allDay&&this.end().startOf("d").valueOf()===this.start().add(1,"d").startOf("d").valueOf()&&this._start.hours()>12&&this._end.hours()start.clone().startOf(period)){start.startOf(period).add(intervalAmount,period)}if(end