當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ionic-native.Calendar類代碼示例

本文整理匯總了TypeScript中ionic-native.Calendar的典型用法代碼示例。如果您正苦於以下問題:TypeScript Calendar類的具體用法?TypeScript Calendar怎麽用?TypeScript Calendar使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Calendar類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: Date

 handler: () => {
   Calendar.createEventInteractively(title, null, body, new Date(), new Date()).then(() => {
     console.log("event made");
   }).catch((err) => {
     console.log(err);
   })
 }
開發者ID:jgw96,項目名稱:NoteAwesome,代碼行數:7,代碼來源:getting-started.ts

示例2: deleteEvent

 public deleteEvent():void{
   Calendar.deleteEvent(this.title, null, this.note, this.startDate, this.endDate).then(data => {
     this.nav.present(Toast.create({
       message:data===true ? 'Deleted' : 'Not deleted',
       duration:3000
     }));
   });
 }
開發者ID:Webaxx,項目名稱:ionic2-calendar,代碼行數:8,代碼來源:page1.ts

示例3: alert

 Calendar.findEvent(this.meeting.title, this.meeting.location, null, this.meeting.startTime, this.meeting.endTime).then((data) => {
   //alert(JSON.stringify(data));
   // If it doesn't exist create it
   if (data == null || data.length == 0) {
     Calendar.createEvent(this.meeting.title, this.meeting.title, '', this.meeting.startTime, this.meeting.endTime).then((data) => {
       alert(JSON.stringify(data));
     });
   }
 }, (data) => {
開發者ID:ShyAlon,項目名稱:Here,代碼行數:9,代碼來源:detail.ts

示例4:

 Calendar.deleteEvent(this.meeting.title, this.meeting.location, null, this.meeting.startTime, this.meeting.endTime).then((data) => {
   console.log('Deleted Event', data);
   // If it doesn't exist create it
   if (data == null || data.length == 0) {
     Calendar.createEvent(this.meeting.title, this.meeting.title, '', this.meeting.startTime, this.meeting.endTime).then((data) => {
       console.log('Created Event', data);
     });
   }
 }, (data) => {
開發者ID:ShyAlon,項目名稱:Here,代碼行數:9,代碼來源:detail.ts

示例5: calendarCreate

 public calendarCreate(title: string, location: string, notes: string, startDate: Date, endDate: Date): void {
   Calendar.createEventInteractively(title, location, notes, startDate, endDate).then((success) => {
     console.log("created");
     this.savedFlyovers.push({title, startDate});
     localStorage.setItem("savedFlyovers", JSON.stringify(this.savedFlyovers));
   }).catch((error) => {
     console.log("not created");
     console.log(error);
   })
 }
開發者ID:jgw96,項目名稱:InternationalSpaceStationApp,代碼行數:10,代碼來源:locationprovider.ts

示例6: createEvent

  public createEvent():void{

    let options:any = {
      firstReminderMinutes:5
    };

    Calendar.createEventWithOptions(this.title, null, this.note, this.startDate, this.endDate, options).then(() => {
      this.nav.present(Toast.create({
        message:'Created',
        duration:3000
      }));
    });
  }
開發者ID:Webaxx,項目名稱:ionic2-calendar,代碼行數:13,代碼來源:page1.ts

示例7: editMeeting

 editMeeting() {
   this.meeting.startTime = new Date((new Date(this.startTime)).getTime() + this.timezoneMinutes*60*1000);
   this.meeting.endTime = new Date((new Date(this.endTime)).getTime() + this.timezoneMinutes*60*1000);
   console.log(this.meeting);
   this.meeting.update(this.server.db);
   if (!Server.simulation) {
     Calendar.deleteEvent(this.meeting.title, this.meeting.location, null, this.meeting.startTime, this.meeting.endTime).then((data) => {
       console.log('Deleted Event', data);
       // If it doesn't exist create it
       if (data == null || data.length == 0) {
         Calendar.createEvent(this.meeting.title, this.meeting.title, '', this.meeting.startTime, this.meeting.endTime).then((data) => {
           console.log('Created Event', data);
         });
       }
     }, (data) => {
       console.log('Failed to Delete Event', data);
     })
   }
 }
開發者ID:ShyAlon,項目名稱:Here,代碼行數:19,代碼來源:detail.ts

示例8: createCalendar

	createCalendar(time: Date, title: string) {
		const now = new Date();
		const start = new Date(now.getTime());
		start.setMonth(time.getMonth());
		start.setDate(time.getDate());
		if (start < now) {  // 已經過去,下年提醒
			start.setMonth(start.getMonth() + 12);
		}
		start.setHours(0);
		start.setMinutes(0);
		start.setSeconds(0);
		const end = new Date(start.getTime());
		end.setHours(0);
		end.setMinutes(0);
		end.setSeconds(0);
		const note = title + ' 《老豆家譜》';
		Calendar.createEventInteractivelyWithOptions(
			title, null, note, start, end, {firstReminderMinutes: 60 * 15, recurrence: 'yearly', recurrenceInterval: 1}
		);
	}
開發者ID:xuender,項目名稱:family,代碼行數:20,代碼來源:node-modal.ts

示例9: constructor

  constructor(private _navController: NavController, private server: Server) {//, private db: DB) {
    if (!Server.simulation) {
      let dict = {};
      this.items = new Array<Meeting>();
      let start = new Date(new Date().getTime() - 1000 * 60 * 60 * 24);
      let end = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 30);
      Calendar.listEventsInRange(start, end).then((data) => {
        // Android Event 
        /*
        allDay: 0
        calendar_id: "1"
        dtend: 1467189155012
        dtstart: 1467189155012
        eventLocation: ""
        event_id: "1"
        title: ""
        */

        if (data && data.length > 0) {
          for (let i = 0; i < data.length; i++) {
            let cal = data[i];
            let m = new Meeting(-1, cal.dtstart, cal.dtend, cal.title, null, false, cal.eventLocation);
            dict[m.startTime.getTime()] = m;
            this.items.push(m);
          }
        }
      }).then(() => {
        this.server.getMeetings().then((data: Meeting[]) => {
          console.log(dict);
          
          for (let j = 0; j < data.length; j++) {
            let m = data[j];
            if (dict[m.startTime.getTime()]) {
              dict[m.startTime.getTime()].scheduled = true;
              console.log('Scheduled', dict[m.startTime.getTime()].title);
            }
          }
        });
      });
    }
  }
開發者ID:ShyAlon,項目名稱:Here,代碼行數:41,代碼來源:home.ts

示例10: openCalendar

 public openCalendar():void{
   Calendar.openCalendar(this.startDate);
 }
開發者ID:Webaxx,項目名稱:ionic2-calendar,代碼行數:3,代碼來源:page1.ts


注:本文中的ionic-native.Calendar類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。