versionFileHelper.js 692 B

12345678910111213141516171819202122232425
  1. function processDate () {
  2. var date = new Date();
  3. var day = date.getUTCDate();
  4. day = day > 9 ? day : '0' + day;
  5. var month = date.getMonth() + 1;
  6. month = month > 9 ? month : '0' + month;
  7. var minutes = date.getMinutes();
  8. minutes = minutes > 9 ? minutes : '0' + minutes;
  9. var hour = date.getHours();
  10. hour = hour > 9 ? hour : '0' + hour;
  11. return {
  12. year: date.getFullYear(),
  13. month: month,
  14. day: day,
  15. hour: hour,
  16. minutes: minutes
  17. }
  18. }
  19. function formatVersionString () {
  20. var versionInfo = processDate();
  21. return `${versionInfo.year}_${versionInfo.month}_${versionInfo.day} ${versionInfo.hour}_${versionInfo.minutes}`;
  22. }
  23. module.exports = formatVersionString;