Giter Site home page Giter Site logo

Comments (8)

onesine avatar onesine commented on May 25, 2024 1

Hello everyone 👋

Sorry for the delay. Thanks for your interest in this package. It seems to be a strange bug indeed. I have never encountered this problem since. Maybe it's because I haven't been around lately to follow the evolution of the package.

Thanks for your PR @AnalogMemory. I will take a look at it.

from react-tailwindcss-datepicker.

NoahMLoomis avatar NoahMLoomis commented on May 25, 2024

The default is indeed YYYY-MM-DD, so it should've been 2023-01-04. Testing it today, I'm getting 2023-01-03. Must be a bug. Are you overriding the displayFormat prop accidentally? A potential workaround could also be to specify the displayFormat="YYYY-MM-DD, that could fix the bug

from react-tailwindcss-datepicker.

aleguern avatar aleguern commented on May 25, 2024

I'm using the following options :

i18n={"fr"}
inputClassName=""
value={{
  startDate: date,
  endDate: date,
}}
useRange={false}
asSingle={true}
startFrom={new Date(Date.now())}
onChange={(newValue) => console.log(newValue)}

The fix I made was to convert the date with the Date object: (it fixes the leading zero missing)

console.log(date); // 2020-1-1
const leadingZeroDate = new Date(date);
console.log(leadingZeroDate) // 2020-01-01

from react-tailwindcss-datepicker.

NoahMLoomis avatar NoahMLoomis commented on May 25, 2024

Weird bug. Could be related to the i18n format?

from react-tailwindcss-datepicker.

JefteCaro avatar JefteCaro commented on May 25, 2024

Hi @aleguern,

Thank you for the feedback. We'll try to look into it.
or, opening PRs are very much welcome.

from react-tailwindcss-datepicker.

devinmatte avatar devinmatte commented on May 25, 2024

Hi I'm running into this same issue in the latest 1.4.2 release from npm. Is the fix for this not in that release?
When selecting a date from the picker I'm getting 2023-2-7 even when setting displayFormat={'YYYY-MM-DD'}

Any thoughts? I can try manually fixing the output before passing it to downstream functions, but that still seems like an incorrect result

from react-tailwindcss-datepicker.

hcusto avatar hcusto commented on May 25, 2024

I have the same problem also with latest version.

from react-tailwindcss-datepicker.

AnalogMemory avatar AnalogMemory commented on May 25, 2024

@JefteCaro there is open PR that would fix this issue

from react-tailwindcss-datepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.