How to use the quasar.date.adjustDate function in quasar

To help you get started, we’ve selected a few quasar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stormseed / daykeep-calendar-quasar / src / components / calendar / CalendarMixin.js View on Github external
formatTimeFromNumber: function (hourNumber) {
      // TODO: this should be able to handle 24 hour and alternate time formats
      return date.formatDate(
        date.adjustDate(new Date(), { hours: hourNumber }),
        'ha'
      )
    },
    moveTimePeriod: function (params) {
github yunity / karrot-frontend / src / pickups / components / PickupSeriesEdit.vue View on Github external
set (val) {
        val = date.extractDate(val, 'HH:mm')
        val = date.adjustDate(this.edit.startDate, { hours: val.getHours(), minutes: val.getMinutes() })
        if (val < this.edit.startDate) {
          // if the value is in the past add a day (allows pickups over midnight)
          val = addDays(val, 1)
        }
        this.edit.duration = differenceInSeconds(val, this.edit.startDate)
      },
    },
github yunity / karrot-frontend / src / pickups / components / PickupEdit.vue View on Github external
set (val) {
        if (val.length < 5) return
        val = date.extractDate(val, 'HH:mm')
        val = date.adjustDate(this.edit.date, { hours: val.getHours(), minutes: val.getMinutes() })
        if (val <= this.edit.date) {
          // if the value is in the past add a day (allows pickups over midnight)
          this.edit.dateEnd = addDays(val, 1)
          return
        }

        const duration = differenceInSeconds(val, this.edit.date)
        const twentyFourHours = 24 * 60 * 60
        if (duration > twentyFourHours) {
          const cappedDuration = duration % twentyFourHours
          this.edit.dateEnd = addSeconds(this.edit.date, cappedDuration)
          return
        }

        this.edit.dateEnd = val
      },
github yunity / karrot-frontend / src / pickups / components / PickupSeriesEdit.vue View on Github external
set (val) {
        val = date.extractDate(val, 'HH:mm')
        val = date.adjustDate(this.edit.startDate, { hours: val.getHours(), minutes: val.getMinutes() })
        this.edit.startDate = val
      },
    },
github yunity / karrot-frontend / src / pickups / components / PickupSeriesEdit.vue View on Github external
set (val) {
        val = date.extractDate(val, 'YYYY-MM-DD')
        val = date.adjustDate(this.edit.startDate, { year: val.getFullYear(), month: val.getMonth() + 1, date: val.getDate() })
        this.edit.startDate = val
      },
    },
github stormseed / daykeep-calendar-quasar / demo / pages / page-mixins / move-dates.js View on Github external
setADateToADay: function (dateObject, addDays) {
      let now = new Date()
      if (typeof dateObject === 'string') {
        dateObject = new Date(dateObject)
      }
      dateObject = date.adjustDate(
        dateObject, {
          year: now.getFullYear(),
          month: now.getMonth() + 1,
          date: now.getDate()
        }
      )
      if (addDays !== undefined) {
        dateObject = date.addToDate(
          dateObject, {
            days: addDays
          }
        )
      }
      return dateObject
    },
    getSqlDateFormat: function (dateObject, withTime) {
github yunity / karrot-frontend / src / pickups / components / PickupEdit.vue View on Github external
set (val) {
        val = date.extractDate(val, 'HH:mm')
        val = date.adjustDate(this.edit.date, { hours: val.getHours(), minutes: val.getMinutes() })
        this.date = val
      },
    },