MCPcopy Create free account
hub / github.com/TGX-Android/Publisher / monthYears

Function monthYears

main.js:508–522  ·  view source on GitHub ↗
(now, then)

Source from the content-addressed store, hash-verified

506}
507
508function monthYears (now, then) {
509 let years = now.getUTCFullYear() - then.getUTCFullYear()
510 let months = 0;
511 if (now.getUTCMonth() < then.getUTCMonth() ||
512 (now.getUTCMonth() === then.getUTCMonth() && now.getUTCDate() < then.getUTCDate())) {
513 years--
514 months = 12 - then.getUTCMonth() + now.getUTCMonth()
515 } else {
516 months = now.getUTCMonth() - then.getUTCMonth()
517 }
518 if (now.getUTCDate() < then.getUTCDate()) {
519 months--
520 }
521 return years + '.' + months;
522}
523
524function getAppVersion (callback) {
525 fs.readFile(settings.TGX_SOURCE_PATH + '/version.properties', 'utf-8', function (err, data) {

Callers 1

getAppVersionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected