Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

gDate2Cal 0.1

Userscript to replace dates in gmail with links to google calendar

This userscript recognizes dates and replaces them with links to Google Calendar. So, suppose someone sends you an invitation for a particular date, it will be transformed to a link to that day in Google Calendar.

Currently the following date formats are supported (more to come, write down your (language-specific) requests in the comments!):

English
September 1st (Year will be determined)
September 1st 2009
2007-09-01
2007/09/01

Dutch
1 September
1 September 2007




Jan 14, 2008
Fabrizio Scriptwright

I modified the first few lines to add italian, then I got too lazy, seeing how hard would have been for me to add the date format suggested by Ash...
anyhow, this is my contribute...

var aRegExpMonthsEn = 'January|February|March|April|May|June|July|August|September|October|November|December';
var aRegExpMonthsNl = 'Januari|Februari|Maart|April|Mei|Juni|Juli|Augustus|September|Oktober|November|December';
var aRegExpMonthsIt = 'Gennaio|Febbraio|Marzo|Aprile|Maggio|Giugno|Luglio|Agosto|Settembre|Ottobre|Novembre|Dicembre';

var getMonthByStr = function(strMonth) {
if(strMonth == 'January' || strMonth == 'Januari' || strMonth == 'january' || strMonth == 'januari'|| strMonth == 'Gennaio'|| strMonth == 'gennaio') return '1';
if(strMonth == 'February' || strMonth == 'Februari' || strMonth == 'february' || strMonth == 'februari' || strMonth == 'Febbraio'|| strMonth == 'febbraio') return '2';
if(strMonth == 'March' || strMonth == 'Maart' || strMonth == 'march' || strMonth == 'maart' || strMonth == 'Marzo' || strMonth == 'marzo') return '3';
if(strMonth == 'April' || strMonth == 'april' || strMonth == 'Aprile'|| strMonth == 'aprile') return '4';
if(strMonth == 'May' || strMonth == 'Mei' || strMonth == 'may' || strMonth == 'mei' || strMonth == 'Maggio'|| strMonth == 'maggio') return '5';
if(strMonth == 'June' || strMonth == 'Juni' || strMonth == 'june' || strMonth == 'juni' || strMonth == 'Giugno'|| strMonth == 'giugno') return '6';
if(strMonth == 'July' || strMonth == 'Juli' || strMonth == 'july' || strMonth == 'juli' || strMonth == 'Luglio'|| strMonth == 'luglio') return '7';
if(strMonth == 'August' || strMonth == 'Augustus' || strMonth == 'august' || strMonth == 'augustus' || strMonth == 'Agosto'|| strMonth == 'agosto') return '8';
if(strMonth == 'September' || strMonth == 'september' || strMonth == 'Settembre'|| strMonth == 'settembre') return '9';
if(strMonth == 'October' || strMonth == 'Oktober' || strMonth == 'october' || strMonth == 'oktober' || strMonth == 'Ottobre'|| strMonth == 'ottobre') return '10';
if(strMonth == 'November' || strMonth == 'november' || strMonth == 'Novembre'|| strMonth == 'novembre') return '11';
if(strMonth == 'December' || strMonth == 'dedember' || strMonth == 'Dicembre'|| strMonth == 'dicembre') return '12';
}

 
Dec 19, 2007
Nathan Sudds User

This is definitely a helpful script, is there a way to prevent the script from converting dates in links though? I find that url's containing dates become "broken" causing email newsletters etc, to be jumbled like this...

Manuel Amador has detailed why he believes 2007/12/11/removal-of-ogg-vorbis-and-theora-from-html5-an-outrageous-disaster/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">the decision to omit these open formats to be an “outrageous disaster:”
(from a www.sitepoint.com newsletter)

Thanks

 
Dec 9, 2007
Ash Styles User

How about (UK style):
01/12/2007 (dd/mm/yyyy)
01/12 (dd/mm)
1/12/2007 (d/mm/yyyy)
1/12 (d/mm)
1/12/07 (d/mm/yy)
and the same with hyphens instead of slashes?

You could comment on this script if you were logged in.