Skip to content

Commit

Permalink
feat(dependencies): remove dateformat as a direct dependecy
Browse files Browse the repository at this point in the history
  • Loading branch information
Juned Kazi committed Jan 30, 2020
1 parent 84d32f1 commit 6044e91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/release/questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

const inquirer = require('inquirer');
const semver = require('semver');
const dateformat = require('dateformat');
const dateFormatOptions = {
year: 'numeric',
month: '2-digit',
day: '2-digit',
};

function askQuestions(themeConfig, githubToken, remotes, callback) {
const remoteChoices = remotes.map(remote => {
Expand Down Expand Up @@ -48,7 +52,7 @@ function askQuestions(themeConfig, githubToken, remotes, callback) {
name: 'version',
type: 'input',
message: 'What specific version would you like',
when: answers => answers['version'] == 'custom',
when: answers => answers['version'] === 'custom',
validate: value => {
const valid = semver.valid(value) && true;

Expand Down Expand Up @@ -87,7 +91,7 @@ function askQuestions(themeConfig, githubToken, remotes, callback) {
return callback(new Error('Operation cancelled'));
}

answers.date = dateformat(new Date(), 'yyyy-mm-dd');
answers.date = new Date().toLocaleString('en-US', dateFormatOptions).split('/').join('-');

callback(null, answers);
});
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"colors": "^1.0.3",
"commander": "^2.7.1",
"confidence": "^1.0.0",
"dateformat": "^2.0.0",
"decompress-zip": "^0.2.0",
"eslint": "^2.2.0",
"eslint-config-airbnb": "^6.0.2",
Expand Down

0 comments on commit 6044e91

Please sign in to comment.