Have you ever looked at a date on a picture or a file and wondered, “What day of the week was that?” In this tech tip I show you how to setup Google Chrome so you can type a date in the address bar and open Google Calendar to that specific day.
Would you prefer a video version of this article? Click here: http://technoju.do/GkTNd
In a previous Tech Tip tutorial we learned how to conveniently search multiple websites from the address bar using Google Chrome Custom Search Engines. Many readers shared how they employed this tip to search their email, search for available domains or to search their favorite shopping sites. In this tech tip, we’re going to build on that lesson and extend the power of Google Chrome Custom Search Engines by adding a little JavaScript. Don’t worry. There is no previous coding experience required. I have included everything you need below to copy, paste and use the Go To Date shortcut for Google Chrome today!
For those of you who are interested in a little background, the default application of Google Chrome Custom Search Engines is useful for returning information such as search results. JavaScript is a programming language that allows us to go one step further and perform actions including, but not limited to, manipulating text, running calculations, executing commands and clicking on buttons. Performing a normal custom search is like retrieving specific documents from a file drawer (e.g. applications with the name Luckett), whereas a JavaScript powered custom search is like retrieving specific documents from a file drawer AND highlighting the name of the applicants who live more than 30 minutes away from the office based on their address. A normal custom search returns information. A JavaScript powered custom search allows us to act upon information. And, because JavaScript is widely used throughout the Internet, the software to run JavaScript is already built into your browser. You will not need to install any additional software.
Here is the code for the Go To Date shortcut for Google Chrome:
javascript: n='%s'; /* Check if dash "-" is used rather than slash "/" */ /* http://www.w3schools.com/jsref/jsref_indexof.asp */ n1 = n.indexOf("-"); if ( n1 < 0 ) { ; } else { n = n.replace("-","/"); } var array = n.split('/'), mm = array[0], dd = array[1], yy = array[2]; void(window.open('https://calendar.google.com/calendar/r/day/'+yy+'/'+mm+'/'+dd));
To use this in Google Chrome, perform the following steps:
1. Copy the JavaScript code for Go To Date code provided above by clicking the Copy button.
2. Open the settings page to add a custom search engine by Right-Clicking on the address bar > and selecting “Edit search engines…”
3. Add a custom search engine by clicking the Add button on the Search settings page.
4. Complete the fields in the Add search engine window.
a. Type a name for the custom search engine under “Search engine”. In this example we will use Google Calendar Go To Date.
b. Type a keyword to use to perform this search.
TIP: Use a short keyword such as “gtd” to reduce typing.
c. Paste in the JavaScript code you copied in step 1 into the field with the label “URL with %s in place of query”.
d. Click the Add button to complete the addition of the custom search engine.
5. Use your new Go To Date shortcut for Google Chrome by opening a new tab > Click in the address bar > type the keyword you setup (e.g. gtd) > press the Tab key or Space bar and enter the date you want to look up in the format MM/DD/YYYY (for example 01/12/2019) and press the Enter key.
6. Google Chrome should open Google Calendar to the day of the week for the date you specified!