@afeefa/vue-app 0.0.166 → 0.0.167
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.167
|
package/package.json
CHANGED
@@ -182,11 +182,15 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin, UsesPositio
|
|
182
182
|
return null
|
183
183
|
}
|
184
184
|
|
185
|
+
return this.dateToString(this.value_).substr(0, this.type === 'month' ? 7 : 10)
|
186
|
+
}
|
187
|
+
|
188
|
+
dateToString (date) {
|
185
189
|
// format date to v-date-picker compatible string: https://stackoverflow.com/a/29774197
|
186
|
-
|
187
|
-
|
188
|
-
date = date.
|
189
|
-
return date
|
190
|
+
// respecting and adding local time zone time shift to the utc iso string
|
191
|
+
const offset = date.getTimezoneOffset()
|
192
|
+
date = new Date(date.getTime() - (offset * 60 * 1000))
|
193
|
+
return date.toISOString()
|
190
194
|
}
|
191
195
|
|
192
196
|
get label () {
|
@@ -208,15 +212,16 @@ export default class ADatePicker extends Mixins(ComponentWidthMixin, UsesPositio
|
|
208
212
|
this.dateChanged(null)
|
209
213
|
} else if (this.validateTextInput(value)) {
|
210
214
|
const [day, month, year] = value.split('.')
|
211
|
-
|
215
|
+
const date = new Date(year + '-' + month + '-' + day)
|
216
|
+
this.dateChanged(this.dateToString(date).split('T')[0])
|
212
217
|
}
|
213
218
|
}
|
214
219
|
|
215
|
-
dateChanged (date) {
|
220
|
+
dateChanged (date) { // date is a yyyy-mm or yyyy-mm-dd string
|
216
221
|
if (date) {
|
217
|
-
|
218
|
-
|
219
|
-
|
222
|
+
// take given date string an create a local time date object
|
223
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format
|
224
|
+
// > When the time zone offset is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as local time.
|
220
225
|
const dateStringThatGetsConvertedToLocalDate = date + 'T00:00'
|
221
226
|
this.value_ = new Date(dateStringThatGetsConvertedToLocalDate)
|
222
227
|
} else {
|
@@ -76,7 +76,6 @@ export default class FlyingContextContainer extends Vue {
|
|
76
76
|
|
77
77
|
this.visible = !!container.children.length
|
78
78
|
const isOpening = mutationRecords.length === 1 && mutationRecords[0].addedNodes.length === 1 // only 1 record ... and this one is 'added'
|
79
|
-
console.log(mutationRecords)
|
80
79
|
|
81
80
|
const el = document.documentElement
|
82
81
|
|