[ Launch: Promo Calendar ] 7030175 by sudhakarr
-
-
Save su-docker/7030175 to your computer and use it in GitHub Desktop.
Promo Calendar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"Promo Calendar","endpoint":"","display":"svg","public":true,"require":[{"name":"underscore","url":"http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"utils.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/hR42SF6.png"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Dates | |
function getDates(year) { | |
var date = new Date(year,0,1); | |
var allDates = {0: [], 1: [], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [], 8: [], 9: [], 10: [], 11: []}; | |
while(date.getFullYear() == year) { | |
allDates[date.getMonth()].push(date); | |
var aDate = new Date(date); | |
aDate.setDate(date.getDate()+1); | |
date = aDate; | |
} | |
return allDates; | |
} | |
var dates = getDates(2013); | |
var svg = d3.select("svg"); | |
var months = svg.selectAll('.month').data(dates); | |
months | |
.enter() | |
.append("g"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment