本文整理汇总了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;未经允许,请勿转载。 |
请发表评论