mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 19:23:55 +00:00
* Update eslint * Do eslint --fix * Do not access Object.prototype method 'hasOwnProperty' from target object * utils: add hasProperty * eslint --fix * Disable quote-props for locale files * add back quotes in locale files * revert locale files to state on master * Update react-scripts
17 lines
461 B
JavaScript
17 lines
461 B
JavaScript
/**
|
|
* Returns a timestamp in the format of `hours:minutes:seconds`
|
|
*/
|
|
module.exports = function getTimeStamp () {
|
|
var date = new Date()
|
|
var hours = pad(date.getHours().toString())
|
|
var minutes = pad(date.getMinutes().toString())
|
|
var seconds = pad(date.getSeconds().toString())
|
|
return hours + ':' + minutes + ':' + seconds
|
|
}
|
|
|
|
/**
|
|
* Adds zero to strings shorter than two characters
|
|
*/
|
|
function pad (str) {
|
|
return str.length !== 2 ? 0 + str : str
|
|
}
|