MCPcopy
hub / github.com/spencermountain/spacetime / year

Function year

builds/spacetime.cjs:3020–3039  ·  view source on GitHub ↗
(s, n)

Source from the content-addressed store, hash-verified

3018 };
3019
3020 const year = function (s, n) {
3021 // support '97
3022 if (typeof n === 'string' && /^'[0-9]{2}$/.test(n)) {
3023 n = n.replace(/'/, '').trim();
3024 n = Number(n);
3025 // '89 is 1989
3026 if (n > 30) {
3027 //change this in 10y
3028 n = 1900 + n;
3029 } else {
3030 // '12 is 2012
3031 n = 2000 + n;
3032 }
3033 }
3034 n = validate(n);
3035 walkTo(s, {
3036 year: n
3037 });
3038 return s.epoch
3039 };
3040
3041 const week = function (s, n, goFwd) {
3042 const old = s.clone();

Callers 1

spacetime.cjsFile · 0.70

Calls 2

validateFunction · 0.70
walkToFunction · 0.70

Tested by

no test coverage detected