Skip to content

Instantly share code, notes, and snippets.

@yosmoc
Created March 28, 2009 07:20
Show Gist options
  • Select an option

  • Save yosmoc/87047 to your computer and use it in GitHub Desktop.

Select an option

Save yosmoc/87047 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name gmail_add_date_label.user.js
// @namespace http://d.hatena.ne.jp/samurai20000/
// @include http://mail.google.com/mail/#settings/labels
// ==/UserScript==
(function() {
// main
var schedule = one_year_calender();
for (i = 0; i < schedule.length; i++) {
label = schedule[i].getFullYear() + "." + (schedule[i].getMonth() + 1) + "." + schedule[i].getDate();
}
// utility
function one_year_calender() {
var today = new Date().getTime();
var calender = [];
for (i = 1; i < 365; i++) {
add_time = i * 24 * 60 * 60 * 1000;
var new_date = new Date(today + add_time);
calender.push(new_date);
}
return calender;
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment