/components/input/date-time

import { input } from "@hedia/hexui/components/input";

export default function Default() {
  const now = new Date();
  const localIsoString = new Date(now.getTime() - now.getTimezoneOffset() * 60000).toISOString();

  return [
    input({
      // autofocus: true,
      id: "date-input",
      label: "Date Input",
      type: "date",
      value: localIsoString.slice(0, 10),
    }),
    input({
      id: "time-input",
      label: "Time Input",
      type: "time",
      value: localIsoString.slice(11, 16),
    }),
    input({
      id: "datetime-local-input",
      label: "Date and Time Input",
      type: "datetime-local",
      value: localIsoString.slice(0, 16),
    }),
    input({
      id: "month-input",
      label: "Month Input",
      type: "month",
      value: localIsoString.slice(0, 7),
    }),
    input({
      id: "week-input",
      label: "Week Input",
      type: "week",
    }),
  ];
}