Spaces:
Running
Running
File size: 1,264 Bytes
68185ce |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
/**
* Get the current date and time.
* @returns {{ iso: string, local: string }} The current date and time as ISO and local time strings.
*/
export function get_time() {
const now = new Date();
return {
iso: now.toISOString(),
local: now.toLocaleString(undefined, {
dateStyle: "full",
timeStyle: "long",
}),
};
}
export default (input, output) =>
React.createElement(
"div",
{ className: "bg-amber-50 border border-amber-200 rounded-lg p-4" },
React.createElement(
"div",
{ className: "flex items-center mb-2" },
React.createElement(
"div",
{
className:
"w-8 h-8 bg-amber-100 rounded-full flex items-center justify-center mr-3",
},
"🕐",
),
React.createElement(
"h3",
{ className: "text-amber-900 font-semibold" },
"Current Time",
),
),
React.createElement(
"div",
{ className: "text-sm space-y-1" },
React.createElement(
"p",
{ className: "text-amber-700 font-mono" },
output.local,
),
React.createElement(
"p",
{ className: "text-amber-600 text-xs" },
new Date(output.iso).toLocaleString(),
),
),
);
|