Skip to content

Commit 3c4cea3

Browse files
committed
2 parents cec42cc + 81e9e99 commit 3c4cea3

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

modules/base/time/zephyr/modTime.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2025 Moddable Tech, Inc.
2+
* Copyright (c) 2025-2026 Moddable Tech, Inc.
33
*
44
* This file is part of the Moddable SDK Runtime.
55
*
@@ -28,29 +28,28 @@ void xs_time_set(xsMachine *the)
2828
{
2929
struct timespec ts = { .tv_sec = xsmcToInteger(xsArg(0)) };
3030
sys_clock_settime(SYS_CLOCK_REALTIME, &ts);
31-
32-
ts.tv_sec = 0;
33-
sys_clock_gettime(SYS_CLOCK_REALTIME, &ts);
3431
}
3532

3633
void xs_time_timezone_get(xsMachine *the)
3734
{
38-
xsUnknownError("unimplemented");
35+
xsmcSetInteger(xsResult, modGetTimeZone());
3936
}
4037

4138
void xs_time_timezone_set(xsMachine *the)
4239
{
43-
xsUnknownError("unimplemented");
40+
int32_t seconds = xsmcToInteger(xsArg(0));
41+
modSetTimeZone(seconds);
4442
}
4543

4644
void xs_time_dst_get(xsMachine *the)
4745
{
48-
xsUnknownError("unimplemented");
46+
int32_t seconds = xsmcToInteger(xsArg(0));
47+
modSetDaylightSavingsOffset(seconds);
4948
}
5049

5150
void xs_time_dst_set(xsMachine *the)
5251
{
53-
xsUnknownError("unimplemented");
52+
xsmcSetInteger(xsResult, modMilliseconds());
5453
}
5554

5655
void xs_time_ticks(xsMachine *the)

modules/commodetto/commodettoPocoCore.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
#include "commodettoPixelsOut.h"
3737
#include "commodettoFontEngine.h"
3838

39-
#undef MODDEF_ECMA419_DISPLAY
40-
4139
#include "stddef.h" // for offsetof macro
4240
#include "stdint.h"
4341
#include "stdlib.h"

tools/testmc/main.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Object.defineProperty(globalThis, "screen", {
124124

125125
if (config.Screen) {
126126
value = new config.Screen({});
127-
width = value.width,
127+
width = value.width;
128128
height = value.height;
129129
}
130130
Object.defineProperty(globalThis, "screen", {
@@ -134,8 +134,8 @@ Object.defineProperty(globalThis, "screen", {
134134
value
135135
});
136136

137-
screen = new Screen({width: width ?? 240, height: height ?? 320});
138-
screen.configure({show: true});
137+
screen = new Screen({width: config.mc_width ?? width ?? 240, height: config.mc_height ?? height ?? 320});
138+
screen.configure({show: ((undefined === config.mc_width) && (undefined === config.mc_height)) || ((width === config.mc_width) && (height === config.mc_height))});
139139

140140
return screen;
141141
},
@@ -146,10 +146,8 @@ Object.defineProperty(globalThis, "screen", {
146146
writable: true,
147147
value
148148
});
149-
150-
screen = new Screen({width: value.width, height: value.height});
151-
152-
return screen;
149+
150+
screen = new Screen({width: config.mc_width ?? value.width, height: config.mc_height ?? value.height});
153151
}
154152
});
155153

0 commit comments

Comments
 (0)