mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-26 11:44:53 +00:00
And rewrite all the require calls. ```bash git mv src/utils/* packages/@uppy/utils/src sed -i 's/[./]*\/utils\//@uppy\/utils\/lib\//' src/**/*.js # transform (../)*utils → @uppy/utils ```
17 lines
459 B
JavaScript
17 lines
459 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
|
|
}
|