@@ -130,13 +130,15 @@ export default Vue.extend({
130130 return this . normalizedModel
131131 . filter ( date => typeof date === 'string' )
132132 . map ( date => this . __decodeString ( date , this . computedMask , this . computedLocale ) )
133+ . filter ( date => date . dateHash !== null )
133134 } ,
134135
135136 rangeModel ( ) {
136137 const fn = date => this . __decodeString ( date , this . computedMask , this . computedLocale )
137138 return this . normalizedModel
138139 . filter ( date => Object ( date ) === date && date . from !== void 0 && date . to !== void 0 )
139- . map ( date => ( { from : fn ( date . from ) , to : fn ( date . to ) } ) )
140+ . map ( range => ( { from : fn ( range . from ) , to : fn ( range . to ) } ) )
141+ . filter ( range => range . from . dateHash !== null && range . to . dateHash !== null )
140142 } ,
141143
142144 getNativeDateFn ( ) {
@@ -172,8 +174,7 @@ export default Vue.extend({
172174 model . day + lineStr + '?'
173175 }
174176
175- if ( this . normalizedModel . length === 0 || this . daysInModel === 0 ) {
176- // TODO: || this.daysModel[0].dateHash === null
177+ if ( this . daysInModel === 0 ) {
177178 return lineStr
178179 }
179180
@@ -202,8 +203,7 @@ export default Vue.extend({
202203 return this . subtitle
203204 }
204205
205- if ( this . daysInModel === 0 || this . daysInModel === 0 ) {
206- // TODO: || this.daysModel[0].year === null
206+ if ( this . daysInModel === 0 ) {
207207 return lineStr
208208 }
209209
@@ -704,29 +704,36 @@ export default Vue.extend({
704704 } ,
705705
706706 __decodeString ( date , mask , locale ) {
707- const decoded = __splitDate (
707+ return __splitDate (
708708 date ,
709709 this . calendar === 'persian' ? 'YYYY/MM/DD' : mask || this . mask ,
710710 locale || this . __getComputedLocale ( ) ,
711- this . calendar
711+ this . calendar ,
712+ {
713+ hour : 0 ,
714+ minute : 0 ,
715+ second : 0 ,
716+ millisecond : 0
717+ }
712718 )
713-
714- decoded . hour = decoded . hour || 0
715- decoded . minute = decoded . minute || 0
716- decoded . second = decoded . second || 0
717- decoded . millisecond = decoded . millisecond || 0
718-
719- return decoded
720719 } ,
721720
722721 __getViewModel ( value ) {
723722 const model = Array . isArray ( value ) === true
724723 ? value
725724 : ( value ? [ value ] : [ ] )
726725
727- return model . length === 0
726+ if ( model . length === 0 ) {
727+ return this . __getDefaultViewModel ( )
728+ }
729+
730+ const decoded = this . __decodeString (
731+ model [ 0 ] . from !== void 0 ? model [ 0 ] . from : model [ 0 ]
732+ )
733+
734+ return decoded . dateHash === null
728735 ? this . __getDefaultViewModel ( )
729- : this . __decodeString ( model [ 0 ] . from !== void 0 ? model [ 0 ] . from : model [ 0 ] )
736+ : decoded
730737 } ,
731738
732739 __getDefaultViewModel ( ) {
0 commit comments