How to use @ionic-native/calendar - 3 common examples

To help you get started, we’ve selected a few @ionic-native/calendar 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 longzheng / mypal-ionic / src / pages / home / home.ts View on Github external
result => {
        // get card ID
        let cardId = this.card().idFormatted()

        // get the last 5 digits of the card (with space)
        let cardLastDigits = cardId.substring(cardId.length - 6)

        // create the calendar event
        Calendar.createEventInteractively(
          `Myki card ${cardLastDigits} expires`,
          null,
          `Card number ${cardId}`,
          this.card().expiry,
          moment(this.card().expiry).add(1, 'days').toDate() // the calendar end date needs to be the "end of day"
        ).catch(() => {
          // there was an error creating event, we probably don't have permission
          let toast = this.toastCtrl.create({
            position: 'top',
            message: 'This app does not have calendar permissions. Please go to settings and enable calendar permissions for this app.',
            duration: 3000
          });
          toast.present();
        })
      })
  }
github longzheng / mypal-ionic / src / pages / home / home.ts View on Github external
addReminder() {
    Calendar.hasWritePermission().then(
      result => {
        if (!result)
          // if we don't have calendar permissions, ask for it
          Calendar.requestWritePermission().then(
            () => {
              // when we have permissions (or think we have permission), move on
              return Promise.resolve()
            }
          )
      })
      .then(
      result => {
        // get card ID
        let cardId = this.card().idFormatted()

        // get the last 5 digits of the card (with space)
github longzheng / mypal-ionic / src / pages / home / home.ts View on Github external
result => {
        if (!result)
          // if we don't have calendar permissions, ask for it
          Calendar.requestWritePermission().then(
            () => {
              // when we have permissions (or think we have permission), move on
              return Promise.resolve()
            }
          )
      })
      .then(

@ionic-native/calendar

Ionic Native - Native plugins for ionic apps

MIT
Latest version published 3 years ago

Package Health Score

75 / 100
Full package analysis

Similar packages