MCPcopy Create free account
hub / github.com/CoderOpen/waimai / formatTime

Function formatTime

front/common/util.js:1–16  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

1function formatTime(time) {
2 if (typeof time !== 'number' || time < 0) {
3 return time
4 }
5
6 var hour = parseInt(time / 3600)
7 time = time % 3600
8 var minute = parseInt(time / 60)
9 time = time % 60
10 var second = time
11
12 return ([hour, minute, second]).map(function (n) {
13 n = n.toString()
14 return n[1] ? n : '0' + n
15 }).join(':')
16}
17
18function formatLocation(longitude, latitude) {
19 if (typeof longitude === 'string' && typeof latitude === 'string') {

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected