rm js fns
This commit is contained in:
4
time.cm
4
time.cm
@@ -161,7 +161,7 @@ function time_text(num = now(),
|
||||
dst = rec.dst;
|
||||
|
||||
/* am/pm */
|
||||
if (fmt.includes("a")) {
|
||||
if (search(fmt, "a") != null) {
|
||||
if (rec.hour >= 13) { rec.hour -= 12; fmt = fmt.replaceAll("a", "PM"); }
|
||||
else if (rec.hour == 12) { fmt = fmt.replaceAll("a", "PM"); }
|
||||
else if (rec.hour == 0) { rec.hour = 12; fmt = fmt.replaceAll("a", "AM"); }
|
||||
@@ -170,7 +170,7 @@ function time_text(num = now(),
|
||||
|
||||
/* BCE/CE */
|
||||
var year = rec.year > 0 ? rec.year : rec.year - 1;
|
||||
if (fmt.includes("c")) {
|
||||
if (search(fmt, "c") != null) {
|
||||
if (year < 0) { year = abs(year); fmt = fmt.replaceAll("c", "BC"); }
|
||||
else fmt = fmt.replaceAll("c", "AD");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user