Started working on getting the time logged today.
This commit is contained in:
@@ -15,6 +15,8 @@ var config = {
|
||||
currentUserApiUrl: 'https://wakatime.com/api/v1/users/current',
|
||||
// The url to logout the user from wakatime
|
||||
logoutUserUrl: 'https://wakatime.com/logout',
|
||||
// Gets stats from the WakaTime API
|
||||
summariesApiUrl: 'https://wakatime.com/api/v1/users/current/summaries',
|
||||
// Different colors for different states of the extension
|
||||
colors: {
|
||||
allGood: '',
|
||||
|
||||
13
assets/js/helpers/getTodaysDateInFormat.js
Normal file
13
assets/js/helpers/getTodaysDateInFormat.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function getTodaysDateInFormat()
|
||||
{
|
||||
var today = new Date();
|
||||
var month = today.getMonth() + 1;
|
||||
var date = today.getDate();
|
||||
|
||||
if(month < 10) month = '0' + month;
|
||||
if(date < 10) date = '0' + date;
|
||||
|
||||
return today.getFullYear() + '-' + month + '-' + date;
|
||||
}
|
||||
|
||||
export default getTodaysDateInFormat;
|
||||
14
package.json
14
package.json
@@ -15,21 +15,21 @@
|
||||
},
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"babel-jest": "^5.2.0",
|
||||
"chai": "^3.0.0",
|
||||
"babel-jest": "^5.3.0",
|
||||
"gulp": "^3.8.8",
|
||||
"jest-cli": "^0.4.10",
|
||||
"babel": "^5.5.6",
|
||||
"jest-cli": "^0.4.12",
|
||||
"laravel-elixir": "*",
|
||||
"react-tools": "^0.13.3",
|
||||
"mocha": "^2.2.5",
|
||||
"mocha-sinon": "^1.1.4",
|
||||
"mocha-traceur": "^2.1.0",
|
||||
"sinon": "^1.14.1"
|
||||
"sinon": "^1.14.1",
|
||||
"babel": "^5.5.6",
|
||||
"chai": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"bootstrap": "^3.3.4",
|
||||
"jquery": "^2.1.3",
|
||||
"react": "^0.13.3",
|
||||
"react-tools": "^0.13.3"
|
||||
"react": "^0.13.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,6 +530,8 @@ var config = {
|
||||
currentUserApiUrl: 'https://wakatime.com/api/v1/users/current',
|
||||
// The url to logout the user from wakatime
|
||||
logoutUserUrl: 'https://wakatime.com/logout',
|
||||
// Gets stats from the WakaTime API
|
||||
summariesApiUrl: 'https://wakatime.com/api/v1/users/current/summaries',
|
||||
// Different colors for different states of the extension
|
||||
colors: {
|
||||
allGood: '',
|
||||
|
||||
@@ -119,6 +119,8 @@ var config = {
|
||||
currentUserApiUrl: 'https://wakatime.com/api/v1/users/current',
|
||||
// The url to logout the user from wakatime
|
||||
logoutUserUrl: 'https://wakatime.com/logout',
|
||||
// Gets stats from the WakaTime API
|
||||
summariesApiUrl: 'https://wakatime.com/api/v1/users/current/summaries',
|
||||
// Different colors for different states of the extension
|
||||
colors: {
|
||||
allGood: '',
|
||||
|
||||
@@ -89,6 +89,8 @@ var config = {
|
||||
currentUserApiUrl: 'https://wakatime.com/api/v1/users/current',
|
||||
// The url to logout the user from wakatime
|
||||
logoutUserUrl: 'https://wakatime.com/logout',
|
||||
// Gets stats from the WakaTime API
|
||||
summariesApiUrl: 'https://wakatime.com/api/v1/users/current/summaries',
|
||||
// Different colors for different states of the extension
|
||||
colors: {
|
||||
allGood: '',
|
||||
|
||||
14
tests/helpers/getTodaysDateInFormat.spec.js
Normal file
14
tests/helpers/getTodaysDateInFormat.spec.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var chai = require('chai');
|
||||
var expect = chai.expect;
|
||||
|
||||
import getTodaysDateInFormat from '../../assets/js/helpers/getTodaysDateInFormat';
|
||||
|
||||
describe('getTodaysDateInFormat', function() {
|
||||
it('should be a function', function() {
|
||||
expect(getTodaysDateInFormat).to.be.a('function');
|
||||
});
|
||||
|
||||
it('should return todays date in format YYYY-MM-DD', function() {
|
||||
expect(getTodaysDateInFormat()).to.be('2015-06-14');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user