zaman
Version:
React component that helps you to makes simple Farsi/Jalali/Shamsi date picker. It also has range date picker you can select multiple days in multiple months.
130 lines (95 loc) • 4.76 kB
Markdown
Zaman is a lightweight React component for creating a Jalali/Georgian datepicker. There is also a range datepicker and timepicker in Zaman. The module can also be customized to match the appearance of your designs.
I appreciate [Ali Samandar](https://dribbble.com/eanlami)'s design of this library. Give him your support.
check out the [codesandbox link.](https://codesandbox.io/s/new-version-date-picker-6eeepf)
with npm
`$ npm i zaman`
with yarn
`$ yarn add zaman`
| props | type | default |
|----------------------|------------------------------------------------------------|-----------|
| defaultValue | timestamp &
| weekend | number[] | undefined |
| round | string one of thin &
| accentColor | string |
| locale | string one of fa &
| direction | string one of rtl &
| onChange | function | undefined |
| range | boolean | false |
| from | timestamp &
| to | timestamp &
| show | boolean | false |
| inputClass | string | null |
| inputAttributes | object of InputHTMLAttributes | null |
| className | string | null |
| customShowDateFormat | string ex: YYYY MMMM DD or DD/MM etc. | undefined |
| position | right &
| props | type | default |
|-------------|------------------------------------------------------------|---------|
| round | string one of thin &
| accentColor | string |
| locale | string one of fa &
| direction | string one of rtl &
| children | ReactNode | null |
| props | type | default |
|-----------------|------------------------------------------------------------|---------|
| defaultValue | timestamp &
| round | string one of thin &
| accentColor | string |
| locale | string one of fa &
| clockTime | number one of 12 &
| inputClass | string | null |
| inputAttributes | object of InputHTMLAttributes | null |
``` jsx
import { DatePicker } from "zaman";
function App() {
return (
<DatePicker onChange={(e) => console.log(e.value)} />
)
}
```
``` jsx
import { DatePicker } from "zaman";
function App() {
return (
<DatePicker onChange={(e) => console.log(e.from, e.to)} range />
)
}
```
``` jsx
import { Calendar, CalendarProvider } from "zaman";
function App() {
const [calendarValue, setCalendarValue] = useState(new Date())
return (
<CalendarProvider>
<Calendar
defaultValue={calendarValue}
onChange={(e) => setCalendarValue(new Date(e.value))}
/>
</CalendarProvider>
)
}
```
``` jsx
import { TimePicker } from "zaman";
function App() {
return (
<TimePicker
onChange={(e) => console.log(e.hour, e.minute, e.timeConvention)}
/>
)
}
```
[](https://github.com/rzkhosroshahi/zaman/blob/main/LICENSE)