Lingua Time Date and Time Picker

repository·main·Indexed 43 days ago

https://github.com/nainglinnkhant/lingua-time

A Date and Time Picker component version 0.1.0 designed for ShadCN UI. It integrates with react-hook-form via props such as name, dateTime, setDateTime, and onBlur.

Tokens
416
Snippets
3
Records
3
Agent score
6%

What's inside Lingua Time

  1. Install Lingua Time via shadcn

    main

    To add the Lingua Time Date and Time Picker component to your project, use the shadcn CLI to pull the component directly from the remote registry using the following command:

    pnpx shadcn@canary add https://raw.githubusercontent.com/nainglinnkhant/lingua-time/refs/heads/main/public/r/lingua-time.json
  2. Set up the Lingua Time development environment

    main

    If you are contributing to the project or running it locally for development, use bun to manage dependencies and start the development server:

    1. Install dependencies: bun i
    2. Start the dev server: bun dev
    bun i
    bun dev
  3. Use DateTimePicker with react-hook-form

    main

    The DateTimePicker component is designed to work seamlessly with react-hook-form. When integrating it into a form, pass the following props to connect it to the form state:

    • name: The name of the field in the form.
    • dateTime: The current value of the date/time.
    • setDateTime: The callback function to update the value (typically onChange).
    • onBlur: The blur handler for form validation/tracking.
    • disabled: Boolean to disable the picker.
    • autoComplete: Set to "off" to prevent browser interference.
    • aria-describedby: Accessibility attribute (can be passed as undefined).
    <DateTimePicker
      name={name}
      dateTime={value}
      setDateTime={onChange}
      onBlur={onBlur}
      disabled={disabled}
      autoComplete="off"
      aria-describedby={undefined}
    />