How to use the quasar.date.addToDate 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 quasarframework / quasar / dev / components / form / datetime.vue View on Github external
data () {
    return {
      // model: '2016-09-18T10:45:00.000Z',
      model: undefined,
      modelVar: undefined,
      // model: 0,
      defaultValue: '2016-09-18T10:45:00.000Z',

      format: 'MMMM D, YYYY [at] h:mm [[]a[\\]]',

      minMaxModel: date.formatDate(day),

      min: date.subtractFromDate(day, {days: 5}),
      max: date.addToDate(day, {days: 4, month: 1, minutes: 10})
    }
  },
  computed: {
github quasarframework / quasar / dev / components / form / datetime-responsive.vue View on Github external
data () {
    return {
      model: undefined,
      minMaxModel: date.formatDate(day),
      min: date.subtractFromDate(day, {days: 45}),
      max: date.addToDate(day, {days: 8, month: 4, minutes: 10}),
      typeDate: true,
      typeTime: true
    }
  },
  computed: {
github stormseed / daykeep-calendar-quasar / src / components / calendar / CalendarMixin.js View on Github external
dateAdjustWeekday (thisDateObject, weekdayNum) {
      let checkDate = new Date()
      let adjustForward = true
      if (weekdayNum < 0) {
        adjustForward = false
        weekdayNum = Math.abs(weekdayNum)
      }
      for (let counter = 0; counter <= 6; counter++) {
        if (adjustForward) {
          checkDate = date.addToDate(thisDateObject, { days: counter })
        }
        else {
          checkDate = date.subtractFromDate(thisDateObject, { days: counter })
        }
        if (date.getDayOfWeek(checkDate) === weekdayNum) {
          return checkDate
        }
      }
    },
    buildWeekDateArray: function (numberOfDays) {
github stormseed / daykeep-calendar-quasar / src / components / calendar / CalendarMixin.js View on Github external
getForcedWeekDateArray: function (numberOfDays) {
      let bookendDates = this.getForcedWeekBookendDates()
      let returnArray = []
      for (let counter = 0; counter <= numberOfDays - 1; counter++) {
        returnArray.push(
          date.addToDate(bookendDates.first, { days: counter })
        )
      }
      return returnArray
    },
    getWeekDateArray: function (numberOfDays) {
github stormseed / daykeep-calendar-quasar / src / components / calendar / CalendarMixin.js View on Github external
moveTimePeriod: function (params) {
      let paramObj = {}
      paramObj[params.unitType] = params.amount
      this.workingDate = date.addToDate(this.workingDate, paramObj)
    },
    setTimePeriod: function (params) {
github stormseed / daykeep-calendar-quasar / src / components / calendar / CalendarMixin.js View on Github external
getWeekDateArray: function (numberOfDays) {
      let returnArray = []
      for (let counter = 0; counter <= numberOfDays - 1; counter++) {
        returnArray.push(
          date.addToDate(this.workingDate, { days: counter })
        )
      }
      return returnArray
    },
    formatTimeFromNumber: function (hourNumber) {
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) {