Logo
Explore Help
Sign In
gaspersic/freeCodeCamp
1
0
Fork 0
You've already forked freeCodeCamp
Code Issues Pull Requests Projects Releases Wiki Activity
freeCodeCamp/server/utils/date-utils.js

12 lines
249 B
JavaScript
Raw Normal View History

Current and Longest streak calculation fixed Minor refactoring and unit tests added After CR: user-stats file moved to util folder, export keywork added to exported functions, new line added at the end of gulp file User-stats-test file moved to replicate user-stats path in test folder
2015-12-10 14:52:09 -08:00
import moment from 'moment';
// day count between two epochs (inclusive)
export function dayCount([head, tail]) {
return Math.ceil(
moment(moment(head).endOf('day')).diff(
Fix linting errors
2016-01-03 05:39:47 +01:00
moment(tail).startOf('day'),
'days',
Current and Longest streak calculation fixed Minor refactoring and unit tests added After CR: user-stats file moved to util folder, export keywork added to exported functions, new line added at the end of gulp file User-stats-test file moved to replicate user-stats path in test folder
2015-12-10 14:52:09 -08:00
true)
);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 100ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API