mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 13:22:11 +01:00
DATE_FORMAT constant. Fixed showing the latest day.
This commit is contained in:
parent
0809aef044
commit
aeac7d801e
1 changed files with 4 additions and 3 deletions
|
@ -34,6 +34,7 @@ const STORE_PATH = Ul.USER_DIR + "/.git-stats"
|
|||
, "Fri"
|
||||
, "Sat"
|
||||
]
|
||||
, DATE_FORMAT = "MMM D, YYYY"
|
||||
;
|
||||
|
||||
// Constructor
|
||||
|
@ -78,7 +79,7 @@ GitStats.record = function (data, callback) {
|
|||
// Get stats
|
||||
GitStats.get(function (err, stats) {
|
||||
stats = stats || {};
|
||||
var day = data.date.format("MMM D, YYYY")
|
||||
var day = data.date.format(DATE_FORMAT)
|
||||
, today = stats[day] = Object(stats[day])
|
||||
, repo = today[data.url] = Object(today[data.url])
|
||||
;
|
||||
|
@ -113,7 +114,7 @@ GitStats.iterateDays = function (data, callback) {
|
|||
data = Ul.merge({
|
||||
end: Moment()
|
||||
, start: Moment().subtract(1, "years")
|
||||
, format: "MMM D, YYYY"
|
||||
, format: DATE_FORMAT
|
||||
}, data);
|
||||
|
||||
var start = data.start
|
||||
|
@ -121,7 +122,7 @@ GitStats.iterateDays = function (data, callback) {
|
|||
, cDay = null
|
||||
;
|
||||
|
||||
while (!start.isAfter(end)) {
|
||||
while (start.format(DATE_FORMAT) !== end.format(DATE_FORMAT)) {
|
||||
cDay = start.format(data.format);
|
||||
callback(cDay, start);
|
||||
start.add(1, "days")
|
||||
|
|
Loading…
Reference in a new issue