Socket
Book a DemoInstallSign in
Socket

nav-datovelger

Package Overview
Dependencies
Maintainers
14
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nav-datovelger

Datepicker with input and calendar

12.6.0
latest
Source
npmnpm
Version published
Weekly downloads
1.5K
-21.39%
Maintainers
14
Weekly downloads
 
Created
Source

nav-datovelger

Simple datepicker basert på react-day-picker https://www.npmjs.com/package/react-day-picker

Use

import { Datepicker, isISODateString } from 'nav-datovelger';

const BasicDatepicker = () => {
    const [date, setDate] = useState('');
    return (
        <Datepicker onChange={setDato} value={date} />
    );
};

const AdvancedDatePicker = () => {
    const [date, setDate] = useState<string>('');

    return (
        <Datepicker
            locale={'nb'}
            inputId="datepicker-input"
            value={date}
            onChange={setDate}
            inputProps={{
                name: 'dateInput',
                'aria-invalid': date !== '' && isISODateString(date) === false,
            }}
            calendarSettings={{ showWeekNumbers: true }}
            showYearSelector={true}
            limitations={{
                weekendsNotSelectable: false,
                invalidDateRanges: [{
                    from: '2020-04-10',
                    to: '2020-04-11',
                }],
                minDate: '2000-04-03',
                maxDate: '2020-12-12',
            }}
        />
    );
}

Kjøre eksempel-app

Starter app med enkelt eksempel

npm run dev

FAQs

Package last updated on 04 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.