Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rsbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { pluginTypedCSSModules } from "@rsbuild/plugin-typed-css-modules";
export default defineConfig({
plugins: [pluginReact(), pluginTypedCSSModules()],
output: {
assetPrefix: "/newtabplus/",
assetPrefix: ".",
cssModules: {
auto: (resource) => {
return resource.includes("") || resource.includes(".module.");
Expand Down
1 change: 1 addition & 0 deletions src/WidgetMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const WidgetMap = {
size: { width: 4, height: 2 },
settings: {
use24HourClock: false,
showAMPM: false,
showDate: true,
showYear: true,
} satisfies ClockSettings,
Expand Down
1 change: 1 addition & 0 deletions src/widgets/Clock.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
}

.clock {
text-wrap-mode: nowrap;
font-size: 4rem;
font-weight: 700;
}
Expand Down
8 changes: 7 additions & 1 deletion src/widgets/Clock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styles from "./Clock.css";

export interface ClockSettings {
use24HourClock: boolean;
showAMPM: boolean;
showDate: boolean;
showYear: boolean;
}
Expand All @@ -28,7 +29,12 @@ export function Clock({ settings }: WidgetState<ClockSettings>) {
? date.getHours()
: date.getHours() % 12 || 12) +
":" +
date.getMinutes().toString().padStart(2, "0")}
date.getMinutes().toString().padStart(2, "0") +
(!settings.use24HourClock && settings.showAMPM
? date.getHours() > 11
? " PM"
: " AM"
: "")}
</span>
{settings.showDate && (
<span className={styles.date}>
Expand Down