本文整理匯總了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);
})
}
示例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
}));
});
}
示例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) => {
示例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) => {
示例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);
})
}
示例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
}));
});
}
示例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);
})
}
}
示例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}
);
}
示例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);
}
}
});
});
}
}
示例10: openCalendar
public openCalendar():void{
Calendar.openCalendar(this.startDate);
}