Advertisement
mvan231

Recurring event

Feb 19th, 2023
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. // Variables used by Scriptable.
  2. // These must be at the very top of the file. Do not edit.
  3. // icon-color: yellow; icon-glyph: magic;
  4. Calendar.presentPicker(false).then(successCallback,failureCallback)
  5.  
  6. // var calcal
  7. async function successCallback(result) {
  8. calcal=result
  9. console.log(calcal)
  10. console.log(calcal[0])
  11. calSet(calcal[0])
  12. }
  13.  
  14. async function failureCallback(error) {
  15. console.error("Error generating file: " + error);
  16. }
  17.  
  18. function calSet(inpu)
  19. {
  20. console.log('setting cal to inpu variable '+inpu)
  21. var aa=new CalendarEvent()
  22. aa.addRecurrenceRule(RecurrenceRule.yearly(1))
  23. aa.title="test"
  24. aa.isAllDay=true
  25.  
  26. //05 for month is actually june. the months start at 00 instead of 01
  27. cd = new Date(2020,05,30,00,00)
  28. ed=new Date(2020,05,30,23,59)
  29.  
  30. aa.startDate=cd
  31. aa.endDate=ed
  32.  
  33. // item in question
  34. aa.calendar = inpu
  35. // item in question
  36.  
  37. // aa.save()
  38. Script.complete()
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement