MCPcopy
hub / github.com/NUKnightLab/TimelineJS3 / formatBigYear

Method formatBigYear

src/js/language/Language.js:57–76  ·  view source on GitHub ↗
(bigyear, format_name)

Source from the content-addressed store, hash-verified

55 }
56
57 formatBigYear(bigyear, format_name) {
58 var the_year = bigyear.year;
59 var format_list = this.bigdateformats[format_name] || this.bigdateformats['fallback'];
60
61 if (format_list) {
62 for (var i = 0; i < format_list.length; i++) {
63 var tuple = format_list[i];
64 if (Math.abs(the_year / tuple[0]) > 1) {
65 // will we ever deal with distant future dates?
66 return formatNumber(Math.abs(the_year / tuple[0]), tuple[1])
67 }
68 };
69
70 return the_year.toString();
71
72 } else {
73 trace("Language file dateformats missing cosmological. Falling back.");
74 return formatNumber(the_year, format_name);
75 }
76 }
77
78 /**
79 * Look up a localized version of a standard message. While using `_` for the

Callers 1

formatDateMethod · 0.95

Calls 2

traceFunction · 0.90
formatNumberFunction · 0.85

Tested by

no test coverage detected