@afeefa/vue-app 0.0.166 → 0.0.167

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 0.0.166
1
+ 0.0.167
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.166",
3
+ "version": "0.0.167",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -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
- const offset = this.value_.getTimezoneOffset()
187
- let date = new Date(this.value_.getTime() - (offset * 60 * 1000))
188
- date = date.toISOString().substr(0, this.type === 'month' ? 7 : 10)
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
- this.dateChanged(new Date(year + '-' + month + '-' + day))
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
- // take given date string an create a local time date object
218
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format
219
- // > 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.
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