2.2.4 • Published 5 months ago

react-time-picker-input v2.2.4

Weekly downloads
-
License
-
Repository
github
Last release
5 months ago

React-Time-Picker-Input

Simple and light time picker for React app. No moment.js needed

Installation

npm install react-time-picker-input yarn add react-time-picker-input

Import Component

import TimePicker from 'react-time-picker-input'

Import Styles

import "react-time-picker-input/dist/components/TimeInput.css"

Demo

See Demo

Usage

Here's an example of basic usage:

import React, { useState } from 'react';
import TimePicker from 'react-time-picker-input';

function TimePickerTest() {
const [value, setValue] = useState('10:00');

    return (
        <div>
            <TimePicker
                onChange={(newValue)=>setValue(value)}
                value={value}
            />
        </div>
    );

}

Props

PropNameTypedefaultdescription
onChangefunction(date)=>{}It fires every time that time is valid (minute hour exists) and returns date parameter which is date in string 24 hour format
onChangeEveryFormatfunction(date)=>{}Similar to onChange but it can be used when allowDelete is true to get every value no matter if it is valid
valueString"- -"Defines default value of TimePicker. Required format ("HH:mm") ex("22:04") -> always 24Hour format
hour12Formatbooleanfalsemake it true to make input 12HourFormat support see on demo example
allowDeletebooleanfalsemake it true if you want to allow user to delete fields (hour and minutes) using Backspace
disabledbooleanfalsemake it true if you want to block user editting (no change on input can happen and cursor is turned to disabled)
eachInputDropdownbooleanfalsemake it true if you want to activate drodpown for each input (default is automatically not manually managed)
manuallyDisplayDropdownbooleanfalsemake it true if use eachInputDropdown prop to turn each dropdown to manually controlled mode
fullTimeDropdownbooleanfalsemake it true if you want to activate full dropdown time see demo

Custom styling

If Default styles not applied :

Download and import on desired location :

Default Styles File

Edit Style for Desktop:

Input wrapper

.react-time-input-picker {
  // css code here
}

Hour input :

.react-time-input-picker #react-time-input-picker__hourInput {
  // css code here
}

Minute input :

.react-time-input-picker input#react-time-input-picker__minuteInput {
  // css code here
}

AmPm input :

.react-time-input-picker input#react-time-input-picker__amPm {
  // css code here
}

Focus style:

.react-time-input-picker input:focus {
  // css code here
}
or 
.react-time-input-picker input(//inputSelector):focus
{
  // css code here
}

Edit Styles on Mobile :

Input wrapper

.input-time-mobile {
  // css here
}

Made By Eagle Zone

2.2.4

5 months ago

2.1.9

10 months ago

2.1.16

10 months ago

2.1.17

10 months ago

2.1.14

10 months ago

2.1.12

10 months ago

2.1.13

10 months ago

2.1.10

10 months ago

2.1.11

10 months ago

2.1.18

10 months ago

2.1.28

10 months ago

2.1.29

10 months ago

2.1.38

10 months ago

2.1.39

10 months ago

2.1.36

10 months ago

2.1.37

10 months ago

2.1.34

10 months ago

2.1.35

10 months ago

2.1.32

10 months ago

2.1.33

10 months ago

2.1.30

10 months ago

2.1.31

10 months ago

2.2.3

10 months ago

2.1.41

10 months ago

2.1.40

10 months ago

2.1.1

11 months ago

2.1.6

10 months ago

2.1.5

10 months ago

2.1.8

10 months ago

2.1.7

10 months ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.10

2 years ago

2.0.3

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.2

3 years ago

1.6.40

3 years ago

1.6.42

3 years ago

1.6.41

3 years ago

2.0.1

3 years ago

1.6.31

3 years ago

1.6.35

3 years ago

1.6.37

3 years ago

1.6.36

3 years ago

1.6.39

3 years ago

1.6.38

3 years ago

1.6.30

3 years ago

1.6.28

3 years ago

1.6.29

3 years ago

1.6.26

3 years ago

1.6.19

3 years ago

1.6.18

3 years ago

1.6.17

3 years ago

1.6.16

3 years ago

1.6.15

3 years ago

1.6.12

3 years ago

1.6.7

3 years ago

1.6.6

3 years ago

1.6.5

3 years ago

1.6.4

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.5.8

3 years ago

1.5.9

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.9

3 years ago

1.4.8

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago