mirror of https://github.com/espruino/BangleApps
Merge branch 'antonclk-fix-substr+substring-replcaced-by-slice'
commit
a72b7448c9
|
@ -99,7 +99,7 @@ function updateState() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isoStr(date) {
|
function isoStr(date) {
|
||||||
return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).substr(-2) + "-" + ("0" + date.getDate()).substr(-2);
|
return date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
var calWeekBuffer = [false,false,false]; //buffer tz, date, week no (once calculated until other tz or date is requested)
|
var calWeekBuffer = [false,false,false]; //buffer tz, date, week no (once calculated until other tz or date is requested)
|
||||||
|
@ -140,7 +140,7 @@ function draw() {
|
||||||
g.setFontAlign(0, 0).setFont("Anton").drawString(timeStr, x, y); // draw time
|
g.setFontAlign(0, 0).setFont("Anton").drawString(timeStr, x, y); // draw time
|
||||||
if (secondsScreen) {
|
if (secondsScreen) {
|
||||||
y += 65;
|
y += 65;
|
||||||
var secStr = (secondsWithColon ? ":" : "") + ("0" + date.getSeconds()).substr(-2);
|
var secStr = (secondsWithColon ? ":" : "") + ("0" + date.getSeconds()).slice(-2);
|
||||||
if (doColor())
|
if (doColor())
|
||||||
g.setColor(0, 0, 1);
|
g.setColor(0, 0, 1);
|
||||||
g.setFont("AntonSmall");
|
g.setFont("AntonSmall");
|
||||||
|
@ -193,7 +193,7 @@ function draw() {
|
||||||
if (calWeek || weekDay) {
|
if (calWeek || weekDay) {
|
||||||
var dowcwStr = "";
|
var dowcwStr = "";
|
||||||
if (calWeek)
|
if (calWeek)
|
||||||
dowcwStr = " #" + ("0" + ISO8601calWeek(date)).substring(-2);
|
dowcwStr = " #" + ("0" + ISO8601calWeek(date)).slice(-2);
|
||||||
if (weekDay)
|
if (weekDay)
|
||||||
dowcwStr = require("locale").dow(date, calWeek ? 1 : 0) + dowcwStr; //weekDay e.g. Monday or weekDayShort #<calWeek> e.g. Mon #01
|
dowcwStr = require("locale").dow(date, calWeek ? 1 : 0) + dowcwStr; //weekDay e.g. Monday or weekDayShort #<calWeek> e.g. Mon #01
|
||||||
else //week #01
|
else //week #01
|
||||||
|
|
Loading…
Reference in New Issue