Skip to content

Commit 1416417

Browse files
committed
chore: change homepage room every day
1 parent 35e3609 commit 1416417

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/website/docs/.vitepress/theme/components/Examples/BlockNote/ReactBlockNote.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,27 @@ const getRandomElement = (list: any[]) =>
3939
const getRandomColor = () => getRandomElement(colors);
4040
const getRandomName = () => getRandomElement(names);
4141

42+
function getUTCDateYYYYMMDD() {
43+
const now = new Date();
44+
const year = now.getUTCFullYear();
45+
const month = now.getUTCMonth() + 1; // January is 0
46+
const day = now.getUTCDate();
47+
48+
// Add leading zeros to month and day if needed
49+
const formattedMonth = month < 10 ? `0${month}` : `${month}`;
50+
const formattedDay = day < 10 ? `0${day}` : `${day}`;
51+
52+
return `${year}${formattedMonth}${formattedDay}`;
53+
}
54+
4255
export function ReactBlockNote(props: { theme: "light" | "dark" }) {
4356
const [doc, provider] = useMemo(() => {
4457
console.log("create");
4558
const doc = new Y.Doc();
4659
const provider = new YPartyKitProvider(
4760
"blocknote.yousefed.partykit.dev",
4861
// "127.0.0.1:1999", // (dev server)
49-
"homepage-2",
62+
"homepage-" + getUTCDateYYYYMMDD(),
5063
doc
5164
);
5265
return [doc, provider];

0 commit comments

Comments
 (0)