Giter VIP home page Giter VIP logo

Comments (8)

Entropiks avatar Entropiks commented on August 11, 2024 1

I am getting the following error when implementing 'use12Hours' prop on this component in a JSX file but in a project that has TypeScript. Works fine without the 'use12Hours' prop. Any ideas how to get this to work?

Component Code
<TimePicker use12Hours onChange={(handleTimeChange)} value={value} />

Also doesn't work
<TimePicker use12Hours={true} onChange={(handleTimeChange)} value={value} />

Error
TimePicker.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'translatedValue')

Here is my declaration.d.ts file
declare module 'react-ios-time-picker';

from react-ios-time-picker.

MEddarhri avatar MEddarhri commented on August 11, 2024 1

Hi @Entropiks, you may need to check the value and set it like this "12:00 AM" it needs to have the hour format AM or PM to work, and the typescript version is already in the way with also a lot of changes to come

from react-ios-time-picker.

siamahnaf avatar siamahnaf commented on August 11, 2024

Here is typescript version, I create- https://www.npmjs.com/package/react-time-picker-typescript

This is also safe for nextjs ssr!

from react-ios-time-picker.

MEddarhri avatar MEddarhri commented on August 11, 2024

Still working on it, will support typescript and many more functionalities like infinite scroll and seconds too

from react-ios-time-picker.

exzile avatar exzile commented on August 11, 2024

Yes it needs the Types file (t.ds). Won't work without it.

from react-ios-time-picker.

Entropiks avatar Entropiks commented on August 11, 2024

Hi @Entropiks, you may need to check the value and set it like this "12:00 AM" it needs to have the hour format AM or PM to work, and the typescript version is already in the way with also a lot of changes to come

This fixed the issue, thank you! Great component.

from react-ios-time-picker.

exzile avatar exzile commented on August 11, 2024

Any update on the Typescript? I have been using a different plugin but would prefer yours.

from react-ios-time-picker.

Gonza69420 avatar Gonza69420 commented on August 11, 2024

This!

from react-ios-time-picker.

Related Issues (11)

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.