1.1.10 • Published 7 months ago

tui-inch-core v1.1.10

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

nextjs-tui-date-picker & nextjs-tui-date-range-picker

  1. nextjs-tui-date-picker
  2. nextjs-tui-date-range-picker

nextjs-tui-date-picker and nextjs-tui-date-range-picker allows you to pick a date using a pop-up calendar in Next.js.

Document

Installation

This library use nextjs-tui-date-range-picker, so you need to install it.

npm install --save nextjs-tui-date-range-picker

or

yarn add nextjs-tui-date-range-picker

How to use

  • TuiDateRangePicker
'use client';

import {
  TuiDateRangePicker,
} from 'nextjs-tui-date-picker';

<TuiDateRangePicker
    handleChange={handleChange}
    options={options}
    inputWidth={80}
    containerWidth={200}
    startpickerDate={new Date('2023-01-02')}
    endpickerDate={new Date('2023-01-30')}
/>
const options: DateRangePickerOption = {
  language: 'en',
  format: 'MM-dd YYYY',
};

return (
  <>
    <TuiDateRangePicker
      handleChange={handleChange}
      options={options}
    />
  </>
);

Demos

  • nextjs-tui-range-picker.

nextjs-tui-range-picker

Properties

Below are nextjs-tui-date-picker specific properties.

ProprequiredTypeDescription
handleChangetrue(e) => voidFunctions to run when value changes
optionsfalse (but recommended)DateRangePickerOptionMore detail
datefalseDateInitial date ( not using nextjs-tui-range-picker)
startpickerDatefalseDateInitial Start date in range-picker (only using in nextjs-tui-range-picker)
endpickerDatefalseDateInitial date End Date in range-picker (only using in nextjs-tui-range-picker)
inputWidthfalsenumberInput width
containerWidthfalsenumberOverall component width

Below are options properties of nextjs-tui-date-picker.

options

ProprequiredTypeDescription
datexDateInitial date. Set by a Date instance or a number(timestamp). (default: no initial date).
languagexstring = 'en'DatePicker type. Determine whether to choose a date, month, or year.
timePickerx object boolean TimePicker options. Refer to the TimePicker instance's options. To create the TimePicker without customization, set to true.
calendarx object Calendar options. Refer to the Calendar instance's options.
inputx object element : HTMLElement, formant : string = 'yyyy-mm--dd'
selectableRangesxArray.<Array.>Ranges of selectable date. Set by Date instances or numbers(timestamp).
openersxArray = []List of the openers to open the DatePicker (example - icon, button, etc.)
showAlwaysxboolean = trueShow the DatePicker always
autoClosexboolean = trueClose the DatePicker after clicking the date.
usageStatisticsxboolean = trueSend a hostname to Google Analytics (default: true)
weekStartDayxstring = 'Sun'Start of the week. 'Sun', 'Mon', ..., 'Sat'(default: 'Sun'(start on Sunday))

Example code

You can see the example code and demo.

Clone the repository

git clone https://github.com/in-ch/nextjs-tui-date-picker.git

Install libraries

cd example/example_nextjs_app_dir

or

cd example/example_nextjs_page_dir

and

npm install

Contribute

You can follow below to contribute nextjs-tui-date-range-picker

Clone the repository.

git clone https://github.com/in-ch/nextjs-tui-date-picker.git
1.1.10

7 months ago

1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

7 months ago