Tags:

Creating a daily event that moves ahead 5 minutes each day.
April 22, 2012 8:11 AM   Subscribe

How do I create a daily calendar event that moves ahead 5 minutes each day?

Ideally using Google Calendar - how can I remind myself to do something every day, but have that reminder move ahead 5 minutes each day? For example, tomorrow I want a this calendar event to be at 7am, the next day, 7:05am, the day after that, 7:10am... and so on... I want the event to appear every day for about half a year - so doing this manually would be time consuming (but that's what I'll do if there's no automated way to do it).

Thanks!
posted by JPDD to Computers & Internet (6 answers total) 1 user marked this as a favorite
 
Not ideal, but better than completely manual: you could easily create the list of events (day + corresponding event time) in excel, and then export as csv and import to your google calendar.
posted by inigo2 at 8:38 AM on April 22, 2012 [2 favorites]


icalendar format can take a MINUTELY recurrence-rule format. With that, you could make the INTERVAL to be the number of minutes in a day plus five. 1445

This doesn't work for me, but it might need some tweak. It will be better than entering a few hundred by hand. Download, edit, and click "Other Calendars / Import".

http://sandbox.chad.org/five-minute-creep.ics
posted by cmiller at 10:48 AM on April 22, 2012


Can you code a bit? If so, it would be easy to do this in Google Apps Script... (you could just create a for loop)
posted by beyond_pink at 11:07 AM on April 22, 2012


I couldn't resist giving it a try - here's a Google Apps Script that will do what you need. To use this, create a new Google Spreadsheet, go to Tools > Script Editor, erase what's there, then copy and paste the script below into it, save, and then click the play button to run the script. The first time you will have to authorize its access to your calendar, then hit play again. Since there is no 'undo' button, try a couple of events (numEvents = 2;) to start and you can always delete manually.

function addMinutes() {
eventDate = new Date("April 20, 2012 07:00:00 EST"); //date and time of first event
eventTitle = "My Event"; //title of the event
eventLength = "1"; //in hours
myCalendarID = "youremailaddress@gmail.com"; //will be your email address unless it's not your primary calendar
numEvents = 4; //how many events you want (try a small number to start - you can always delete them if they didn't work correctly)
minuteOffset = 5; //how many minutes to add

myCalendar = CalendarApp.getCalendarById(myCalendarID);
for(i=0; i myCalendar.createEvent(eventTitle, eventDate, new Date(eventDate.getTime()+eventLength*60*60000));
eventDate = new Date(eventDate.getTime()+24*60*60000+ minuteOffset*60000); //adds 1 day and 5 mins
}
}

posted by beyond_pink at 1:33 PM on April 22, 2012 [1 favorite]


Wow, thanks so much for putting that together! I'm not much of a coder so this may be a simple fix - but I'm getting this error when I try to run it:

Missing ; after for-loop condition. (line 10)
posted by JPDD at 3:57 AM on April 23, 2012


Whoa, when I pasted it something funky happened. Let's see if it works better with the pre tag -
function addMinutes() {
  eventDate = new Date("April 20, 2012 07:00:00 EST"); //date and time of first event
  eventTitle = "My Event"; //title of the event
  eventLength = "1"; //in hours
  myCalendarID = "youremailaddress@gmail.com"; //will be your email address unless it's not your primary calendar
  numEvents = 4; //how many events you want (try 2 to start - you can always delete them if they didn't work correctly)
  minuteOffset = 5; //how many minutes to add
  
  myCalendar = CalendarApp.getCalendarById(myCalendarID);
  for(i=0; i<numEvents; i++){
    myCalendar.createEvent(eventTitle, eventDate, new Date(eventDate.getTime()+eventLength*60*60000));
    eventDate = new Date(eventDate.getTime()+24*60*60000+ minuteOffset*60000); //adds 1 day and 5 mins
  }
}

posted by beyond_pink at 7:22 PM on May 22, 2012


« Older Have you had IVF? What do you ...   |  Seeking suggestions for a vaca... Newer »
This thread is closed to new comments.