Skip to content

Commit

Permalink
Appropriate day labels for the global locale setting of moment.js
Browse files Browse the repository at this point in the history
  • Loading branch information
g1eb committed Apr 28, 2016
1 parent 8276d20 commit b12c692
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion calendar-heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ angular.module('g1b.calendar-heatmap', []).
link: function (scope, element) {

// Defaults
var days = ['M', 'T', 'W', 'T', 'F', 'S', 'S'];
var gutter = 5;
var width = 1000;
var height = 200;
Expand Down Expand Up @@ -213,6 +212,10 @@ angular.module('g1b.calendar-heatmap', []).
.attr('y', label_padding / 2);

// Add day labels
var days = [];
for (var i = 0; i < 7; i++ ) {
days.push(moment().startOf('week').add('days', i).format('dddd')[0]);
}
labels.selectAll('.label-day').remove();
labels.selectAll('.label-day')
.data(days)
Expand Down

0 comments on commit b12c692

Please # to comment.