Code Monkey home page Code Monkey logo

ashvin27 / react-time-range-slider Goto Github PK

View Code? Open in Web Editor NEW
28.0 1.0 11.0 1.06 MB

ReactTimeRangeSlider is a React component allowing users to integrate time range slider. It can accept start and end time. It also allow to define time format default 24 hour time format.

Home Page: https://ashvin27.github.io/react-time-range-slider

License: MIT License

JavaScript 66.02% CSS 33.98%
time-range react-timer react-time-range slider range-slider range

react-time-range-slider's People

Contributors

ashvin27 avatar ashvinpdigivalet avatar mabayed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-time-range-slider's Issues

CSS causes build issues with latest NextJS

running the latest NextJs' build command while using this library causes the build to fail. I tracked it down to the css required in the dist/index.js file. Would like to propose that the css be imported by the user in their app and not something you require/import within your dist.

See PR.

Changing step value does not do anything

Step appears to be 15 minutes despite of the value provided. Checked in /dist/index.js and it does not seem to have a function that would implement step change.
Please make changes or allow access to repo so I could create a PR for this.
Thank you

max value and min value issue

I noticed the maxValue and minValue is not working correctly for example:

 const valueRange: {
      start: "00:00",
      end: "23:59"
    }
const value: { 
  start: "08:30",
 end: "11:30"
}
<template>
<TimeRangeSlider
          format={24}
          disabled={false}
	draggableTrack={true}
          maxValue={valueRange.end}
          minValue={valueRange.start}
          name={"time_range"}
          step={15}
          value={this.value}/>
</template>

Expected: for the above code the draggableTrack shouldn't be draggable when it reach to it maxValue and same for minValue.

Current: I can drag the track about the maxValue and same for minValue.

how to pass event parameter to the function in onChange

I'm using formik with yup in my form and I Wanna call manually the onChange of formik in my own onChange function, but I realized that onChange of the TimeRangeSlider just has the current value.

        <TimeRangeSlider
               disabled={!values[day.value]}
               format={24}
               maxValue="23:59"
               minValue="00:00"
               name={`${day.value}Range`}
               onChange={value => { 
                     onChange(); //here I wanna pass the event object
                     setFieldValue(`${day.value}Range`, value)
              }}
               step={15}
               value={values[`${day.value}Range`]} />

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.