Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Variables used by Scriptable.
- // These must be at the very top of the file. Do not edit.
- // icon-color: yellow; icon-glyph: magic;
- Calendar.presentPicker(false).then(successCallback,failureCallback)
- // var calcal
- async function successCallback(result) {
- calcal=result
- console.log(calcal)
- console.log(calcal[0])
- calSet(calcal[0])
- }
- async function failureCallback(error) {
- console.error("Error generating file: " + error);
- }
- function calSet(inpu)
- {
- console.log('setting cal to inpu variable '+inpu)
- var aa=new CalendarEvent()
- aa.addRecurrenceRule(RecurrenceRule.yearly(1))
- aa.title="test"
- aa.isAllDay=true
- //05 for month is actually june. the months start at 00 instead of 01
- cd = new Date(2020,05,30,00,00)
- ed=new Date(2020,05,30,23,59)
- aa.startDate=cd
- aa.endDate=ed
- // item in question
- aa.calendar = inpu
- // item in question
- // aa.save()
- Script.complete()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement