This is the gatsby-styled-blog-starter demo site. To download the code and get some instructions visit the Github repository . To be informed about updates follow @greglobinski

The Calendar and the Date Object

Calendar and Date object

October 01, 2017

I love when people suggest things for videos… even when they aren’t teachers! I made this channel to inspire teachers to think of ways to use coding to build teacher tools, but that doesn’t exclude others from joining the conversation.

There are a ton of ways to use code to make our lives easier and this is another one suggested by a viewer.

function getEvents() {
  var now = new Date();

  var year = now.getYear();
  var month = now.getMonth();
  var day = now.getDay() + 1;

  var today = new Date(year, month, day);
  var tomorrow = new Date(year, month, day, 24);

  var events = CalendarApp.getEvents(today, tomorrow);

  for(var i = 0; i < events.length; i++) {

Creating the date object is the easy part. Once you create the object, there are tons of methods available that allow you to manipulate the object in a number of ways.

Check the docs for more methods that you can use

In my code, all I am doing is using Logger.log to print the title to the apps script log. There are tons of methods available provided by apps script. That documentation can be found here!

What ideas do you have? Hit me up on twitter or my project to make some suggestions of your own!


jordan rhea I started as a teacher and taught myself to code with Python and JavaScript. Now I am passionate about sharing code and strategies to make teachers (and other G Suite users) as effective as possible with technology.

© jordan rhea 2018