Skip to content

Let user only enter day month and time, no year #145

Closed
@ZiangX

Description

@ZiangX

Hi there, I would like to make a datetime picker that the user only needs to enter the day, month and time, no year. And I will default the year to 2021 behind the scene. Is it possible?
image

I tried the code below

 <DateTimePicker
    value={dateTime}
    onChange={setDateTime}
    format="dd/MM HH:mm"
  />

but it shows me an error of "Invalid date: Invalid Date". Could you give me some ideas of how to make it work, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions