Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
chore: Add short date string generator
Browse files Browse the repository at this point in the history
  • Loading branch information
qdot committed Jul 5, 2018
1 parent 3f86416 commit f1b3ce1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build/generate_config.js
Expand Up @@ -6,9 +6,17 @@ const revision = require('child_process')
.execSync('git rev-parse --short HEAD')
.toString().trim();

function pad(str, amount) {
return ("0000" + str).slice(-amount);
}

const currentDate = new Date();
const currentDateString = `${currentDate.getUTCFullYear()}/${pad(currentDate.getMonth(), 2)}/${pad(currentDate.getDay(), 2)} ${pad(currentDate.getHours(), 2)}:${pad(currentDate.getMinutes(), 2)} PT`;

const config = {
build_commit: revision,
build_date: Date(),
short_build_date: currentDateString,
buttplug_version: buttplug.version,
component_version: vuecomponent.version
};
Expand Down

0 comments on commit f1b3ce1

Please sign in to comment.