{"_id":"@danielsenorjan/react-native-ui-datepicker","name":"@danielsenorjan/react-native-ui-datepicker","dist-tags":{"latest":"3.3.1"},"versions":{"3.3.1":{"name":"@danielsenorjan/react-native-ui-datepicker","version":"3.3.1","description":"Customizable date picker for React Native","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","exports":{"import":"./lib/module/index.js","require":"./lib/commonjs/index.js","types":"./lib/typescript/index.d.ts"},"scripts":{"test":"jest","typecheck":"npx tsc --noEmit","lint":"eslint .","prepack":"bob build","release":"release-it","example":"yarn --cwd example","bootstrap":"yarn example && yarn install"},"keywords":["react-native","ios","android","react-native-ui-datetpicker","react-native-datetime","react-native-datetime-picker","react-native-datetpicker","react-native-datet-picker","react-native-timepicker","react-native-time-picker","react-native-calendar","react-native-daterange","datetime","datetime-picker","datepicker","datet-picker","timepicker","time-picker","calendar","daterange"],"repository":{"type":"git","url":"git+https://github.com/danielsenorjan/react-native-ui-datepicker.git"},"author":{"name":"Farhoud Shapouran","email":"shapouran@gmail.com","url":"https://github.com/farhoudshapouran"},"contributors":[{"name":"Ørjan Danielsen","email":"orjan.danielsen@marinedynamics.no","url":"https://github.com/danielsenorjan"}],"license":"MIT","bugs":{"url":"https://github.com/danielsenorjan/react-native-ui-datepicker/issues"},"homepage":"https://github.com/danielsenorjan/react-native-ui-datepicker#readme","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"devDependencies":{"@commitlint/config-conventional":"^17.0.2","@evilmartians/lefthook":"^1.2.2","@react-native-community/eslint-config":"^3.0.2","@react-native/eslint-config":"^0.77.0","@release-it/conventional-changelog":"^8","@testing-library/jest-native":"^5.4.3","@testing-library/react-native":"^12.3.2","@types/jest":"^29.5.14","@types/lodash":"^4.14.202","@types/react":"18.2.0","@types/react-native":"0.72.0","@types/react-test-renderer":"^18.0.0","@typescript-eslint/parser":"^8.24.1","commitlint":"^17.0.2","del-cli":"^5.0.0","eslint":"^9.20.1","eslint-config-prettier":"^10.0.1","eslint-plugin-prettier":"^5.2.3","eslint-plugin-react-hooks":"^5.1.0","eslint-plugin-react-native":"^5.0.0","jest":"^28.1.3","pod-install":"^0.1.0","prettier":"^3.4.2","prettier-plugin-tailwindcss":"^0.6.11","react":"18.2.0","react-native":"0.72.0","react-native-builder-bob":"^0.20.0","react-test-renderer":"18.2.0","release-it":"^17","ts-node":"^10.9.1","typescript":"^5.7.3"},"resolutions":{"@types/react":"18.2.0","@types/react-native":"0.72.0"},"peerDependencies":{"react":"*","react-native":"*"},"engines":{"node":">= 18"},"commitlint":{"extends":["@commitlint/config-conventional"]},"eslintConfig":{"root":true,"extends":["@react-native-community","prettier"],"plugins":["prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true,"useTabs":false}]}},"eslintIgnore":["node_modules/","lib/","example/","demo/","*.config.js","tsconfig.json"],"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"dependencies":{"clsx":"^2.1.1","dayjs":"^1.11.13","jalali-plugin-dayjs":"^1.1.4","lodash":"^4.17.21","tailwind-merge":"^3.0.1"},"_id":"@danielsenorjan/react-native-ui-datepicker@3.3.1","gitHead":"027c92e5902af4eb010cd48dd690e05b2b405488","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-v6xh61Z6c5MDaigEaibOs7dpDc8Mpb/+o5tFmtcJFuOfv4mrnOt5GI2NI1A7HQp85gLSkKMUmzQ3hvo+aMyhjg==","shasum":"beca281d0eb03c8c1eaca666ce546769caf51d35","tarball":"https://registry.npmjs.org/@danielsenorjan/react-native-ui-datepicker/-/react-native-ui-datepicker-3.3.1.tgz","fileCount":280,"unpackedSize":790674,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEqt3uDIBuK5pMY5ZW+jITt7IbAvMY71cIiIumc3sgtpAiEApDADHHOs2f+xE5oluCrScKpo96Z2uqYi25u8Q6XAOIQ="}]},"_npmUser":{"name":"danielsenorjan","email":"orjan@danielsen.biz"},"directories":{},"maintainers":[{"name":"danielsenorjan","email":"orjan@danielsen.biz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-ui-datepicker_3.3.1_1782746324290_0.7372258085770425"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-29T15:18:44.120Z","3.3.1":"2026-06-29T15:18:44.436Z","modified":"2026-06-29T15:18:44.668Z"},"maintainers":[{"name":"danielsenorjan","email":"orjan@danielsen.biz"}],"description":"Customizable date picker for React Native","homepage":"https://github.com/danielsenorjan/react-native-ui-datepicker#readme","keywords":["react-native","ios","android","react-native-ui-datetpicker","react-native-datetime","react-native-datetime-picker","react-native-datetpicker","react-native-datet-picker","react-native-timepicker","react-native-time-picker","react-native-calendar","react-native-daterange","datetime","datetime-picker","datepicker","datet-picker","timepicker","time-picker","calendar","daterange"],"repository":{"type":"git","url":"git+https://github.com/danielsenorjan/react-native-ui-datepicker.git"},"contributors":[{"name":"Ørjan Danielsen","email":"orjan.danielsen@marinedynamics.no","url":"https://github.com/danielsenorjan"}],"author":{"name":"Farhoud Shapouran","email":"shapouran@gmail.com","url":"https://github.com/farhoudshapouran"},"bugs":{"url":"https://github.com/danielsenorjan/react-native-ui-datepicker/issues"},"license":"MIT","readme":"<p align=\"center\">\n<img src=\"/.github/images/rnui-datepicker.png\" alt=\"react-native-ui-datepicker\" />\n</p>\n\n<div align=\"center\">\n\n [![npm version](https://img.shields.io/npm/v/react-native-ui-datepicker)](https://www.npmjs.com/package/react-native-ui-datepicker)\n[![npm downloads](https://img.shields.io/npm/dm/react-native-ui-datepicker.svg)](https://www.npmjs.com/package/react-native-ui-datepicker)\n[![Github](https://img.shields.io/github/license/farhoudshapouran/react-native-ui-datepicker)](https://github.com/farhoudshapouran/react-native-ui-datepicker)\n[![gzipped size](https://img.shields.io/bundlephobia/minzip/react-native-ui-datepicker)](https://www.npmjs.com/package/react-native-ui-datepicker)\n\n</div>\n\n> **Note:** This is a fork of [`react-native-ui-datepicker`](https://github.com/farhoudshapouran/react-native-ui-datepicker) by Farhoud Shapouran, published as [`@danielsenorjan/react-native-ui-datepicker`](https://www.npmjs.com/package/@danielsenorjan/react-native-ui-datepicker) with additional fixes. Install with `npm install @danielsenorjan/react-native-ui-datepicker`. All credit for the original library goes to the upstream author.\n\nDateTimePicker component for React Native that allows you to create a customizable datetime picker. The component uses extensive set of props that allows you to customizing the calendar based on your own UI design. Please visit [demo](https://farhoudshapouran.github.io/react-native-ui-datepicker/).\n\n## Features\n\n- 📅 Supports different selection modes: single, range, and multiple days.\n- 🌿 Unstyled by default, every component is minimally styled and fully customizable.\n- 🛠️ Extensive set of props for fine-tuned calendar customization.\n- 🎨 Fully compatible with [NativeWind](https://www.nativewind.dev/).\n- 🌎 Easily localizable into any language.\n- 🕗 Handles different time zones seamlessly.\n- ⚙️ Customizable components allow extending rendered elements. \n- ⚡ Fast & lightweight, only re-renders the elements that actually change.\n\n## Installation\n\n```sh\nnpm install react-native-ui-datepicker\n```\n\nOr\n\n```sh\nyarn add react-native-ui-datepicker\n```\n\n## Basic Usage\n\n1. Import the component and default styles or classNames from  `react-native-ui-datepicker`.\n2. Choose a selection mode using the `mode` prop. The available modes are: `single`, `range`, and `multiple`.\n\n```jsx\nimport { useState } from  'react';\nimport DateTimePicker, { DateType, useDefaultStyles } from 'react-native-ui-datepicker';\n\nexport function Calendar() {\n  const defaultStyles = useDefaultStyles();\n  const [selected, setSelected] = useState<DateType>();\n\n  return (\n    <DateTimePicker\n      mode=\"single\"\n      date={selected}\n      onChange={({ date }) =>  setSelected(date)}\n      styles={defaultStyles}\n    />\n  );\n}\n```\n\n## Calendar Base Props\n\n| Name               | Type                              | Description                                        |\n| ------------------ | --------------------------------- | -------------------------------------------------- |\n| `mode`               | `\"single\"` \\| `\"range\"` \\| `\"multiple\"`   | Defines the DatePicker mode.                       |\n| `calendar`               | `\"gregory\"` \\| `\"jalali\"`  | Defines the calendar type of DatePicker.                      |\n| `minDate`            | `DateType`                        | Defines the minimum selectable date in the DatePicker.   |\n| `maxDate`            | `DateType`                        | Defines the maximum selectable date in the DatePicker.   |\n| `enabledDates`   | `DateType[]` \\| `(date: DateType) => boolean` | Defines an array of enabled dates or a function that returns `true` for enabled dates. It takes precedence over disabledDates. |\n| `disabledDates`      | `DateType[]` \\| `(date: DateType) => boolean` | Defines an array of disabled dates or a function that returns `true` for disabled dates.  |\n| `firstDayOfWeek`     | `number`                          | Defines the first day of the week: 0-6 (0 = Sunday, 6 = Saturday). |\n| `initialView`        | `\"day\"` \\| `\"month\"` \\| `\"year\"` \\| `\"time\"` | Defines the initial view of the DatePicker |\n| `month`              | `number`                              | Defines the currently selected month.     |\n| `year`              | `number`                              | Defines the currently selected year.      |\n| `onMonthChange`      | `(month: number) => void`             | Callback function triggered when the current month changes.   |\n| `onYearChange`       | `(year: number) => void`              | Callback function triggered when the current year changes.    |\n\n## Example\n\n```jsx\nexport function Calendar() {\n  let today = new Date();\n  const [selected, setSelected] = useState<DateType>();\n\n  return (\n    <DateTimePicker\n      mode=\"single\"\n      date={selected}\n      onChange={({ date }) =>  setSelected(date)}\n      minDate={today} // Set the minimum selectable date to today\n      enabledDates={(date) => dayjs(date).day() === 1} // Enable only Mondays (takes precedence over disabledDates)\n      disabledDates={(date) => [0, 6].includes(dayjs(date).day())} // Disable weekends\n    />\n  );\n}\n```\n\n<p align=\"center\">\n<img src=\"/.github/images/modes-screenshot.png\" />\n</p>\n\n## Single Mode props\n\n| Name         | Type               | Description                                                   |\n| ------------ | ------------------ | ------------------------------------------------------------- |\n| `date`       | `DateType`         | Specifies the currently selected date.                        |\n| `onChange`   | `({date}) => void` | Callback function triggered when the date change.             |\n| `timePicker` | `boolean`          | Whether to enable the time picker.                            |\n| `use12Hours` | `boolean`          | Whether to use a 12-hour format (AM/PM) in the time picker.   |\n\n## Range Mode props\n\n| Name        | Type                             | Description                                                |\n| ----------- | -------------------------------- | -----------------------------------------------------------|\n| `startDate` | `DateType`                       | Defines the start date for a range selection.              |\n| `endDate`   | `DateType`                       | Defines the end date for a range selection.                |\n| `onChange`  | `({startDate, endDate}) => void` | Callback function triggered when the start and end change. |\n| `min`       | `number`                         | Defines the minimum allowed nights.                        |\n| `max`       | `number`                         | Defines the maximum allowed nights.                        |\n| `allowRangeReset` | `boolean`                  | When `true`, tapping any date while a complete range is selected clears the end date and starts a fresh selection from the tapped date. Defaults to `false`. |\n\n## Multiple Mode props\n\n| Name              | Type                | Description                                                 |\n| ----------------- | ------------------- | ----------------------------------------------------------- |\n| `dates`           | `DateType[]`        | Defines the selected dates for multiple date selection.     |\n| `onChange`        | `({dates}) => void` | Callback function triggered when the dates change.          |\n| `max`             | `number`            | Defines the maximum allowed days to select.                 |\n| `multiRangeMode`  | `boolean`           | Whether to display selecting multiple dates in a range row. |\n\n![react-native-ui-datepicker-styles](https://user-images.githubusercontent.com/7857656/227260476-30ee8c25-f809-4dcf-bccf-cd1ffab8795a.jpg)\n\n## Customization\n\n| Name                 | Type                                | Description                                               |\n| -------------------- | ----------------------------------- | --------------------------------------------------------- |\n| `showOutsideDays`    | `boolean`                           | Whether to show the days of the previous and next months. |\n| `navigationPosition` | `\"around\"` \\| `\"right\"` \\| `\"left\"` | Defines the position of the navigation.                   |\n| `containerHeight`    | `number`                            | Defines the height of the calendar days container.        |\n| `weekdaysHeight`     | `number`                            | Defines the height of the weekdays row.                   |\n| `weekdaysFormat`     | `\"short\"` \\| `\"full\"` \\| `\"min\"`    | Defines the format for displaying weekdays.               |\n| `monthsFormat`       | `\"short\"` \\| `\"full\"`               | Defines the format for displaying months.                 |\n| `monthCaptionFormat` | `\"short\"` \\| `\"full\"`               | Defines the format for displaying the month caption.      |\n| `hideHeader`         | `boolean`                           | Whether to hide the calendar header.                      |\n| `hideWeekdays`       | `boolean`                           | Whether to hide the weekdays row.                         |\n| `showMonthSelector`  | `boolean`                           | When `true`, always show the month selector (including in year view). When `false`, hide it. When omitted, show except in year view. |\n| `disableMonthPicker` | `boolean`                           | Whether to disable the month picker.                      |\n| `disableYearPicker`  | `boolean`                           | Whether to disable the year picker.                       |\n\n## Styling\n\nDateTimePicker comes with a minimal style, making it easy to extend and customize according to your needs.\n\n| Name              | Type            | Description                                                     |\n| ----------------- | --------------- | --------------------------------------------------------------- |\n| `style`           | `ViewStyle`     | Style for the outer calendar container (header and body).       |\n| `containerStyle`  | `ViewStyle`     | Style for the inner calendar body (day, month, year, or time view). Does not override `containerHeight`. |\n| `className`       | `string`        | className for the calendar container.                           |\n| `styles`          | `Styles`        | Custom styles for specific components inside the calendar.      |\n| `classNames`      | `ClassNames`    | Custom classNames for specific components inside the calendar.  |\n\n## Custom Styles\n\nUse the `styles` prop to apply custom styles instead of the default ones.\n\nThese styles are mapped to the values of the [UI Theme](https://github.com/farhoudshapouran/react-native-ui-datepicker/blob/main/src/ui.ts) enums.\n\n```jsx\nimport DateTimePicker, { useDefaultStyles } from 'react-native-ui-datepicker';\n\nexport function Calendar() {\n  const defaultStyles = useDefaultStyles();\n\n  return (\n    <DateTimePicker\n      styles={{\n        ...defaultStyles,\n        today: { borderColor: 'blue', borderWidth: 1 }, // Add a border to today's date\n        selected: { backgroundColor: 'blue' }, // Highlight the selected day\n        selected_label: { color: 'white' }, // Highlight the selected day label\n      }}\n    />\n  );\n}\n```\n\n## NativeWind (Tailwind CSS)\n\nIf you're using [NativeWind](https://www.nativewind.dev/) in your project, apply Tailwind CSS class names to style the calendar.\nUse the `classNames` prop to apply custom class names instead of the default ones.\n\nThese class names are mapped to the values of the [UI Theme](https://github.com/farhoudshapouran/react-native-ui-datepicker/blob/main/src/ui.ts) enums.\n\n```jsx\nimport DateTimePicker, { useDefaultClassNames } from 'react-native-ui-datepicker';\n\nexport function Calendar() {\n  const defaultClassNames = useDefaultClassNames();\n\n  return (\n    <DateTimePicker\n      classNames={{\n        ...defaultClassNames,\n        today: 'border-amber-500', // Add a border to today's date\n        selected: 'bg-amber-500 border-amber-500', // Highlight the selected day\n        selected_label: \"text-white\", // Highlight the selected day label\n        day: `${defaultClassNames.day} hover:bg-amber-100`, // Change background color on hover\n        disabled: 'opacity-50', // Make disabled dates appear more faded\n      }}\n    />\n  );\n}\n```\n\n## Time Zones\n\nUse the `timeZone` prop to set the time zone for the calendar.\n\n| Name           | Type               | Description                                |\n| -------------- | ------------------ | ------------------------------------------ |\n| `timeZone`     | `string`           | Defines the timezone for the DatePicker.   |\n\nThe time zone can be set using either an [IANA time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) identifier or a UTC offset.\n\n```jsx\n<DateTimePicker timeZone=\"UTC\" /> // Use Coordinated Universal Time\n<DateTimePicker timeZone=\"Asia/Tokyo\" /> //  Use Japan Standard Time (JST)\n```\n\n## Localization\n\nDateTimePicker offers multiple options to customize the calendar for different languages.\n\n| Name         | Type                                 | Description                                                  |\n| ------------ | ------------------------------------ | ------------------------------------------------------------ |\n| `locale`     | `string`                             | Defines the locale of the DateTimePicker. Default is `en`    |\n| `numerals`   | [Numerals](#list-of-numeral-systems) | Specifies the numeral system to use (e.g., Arabic, Persian). |\n\n## Custom Components\n\nUse the `components` prop to replace the default rendered elements with your own custom components.\n\n| Name            | Type                      | Description                                              |\n| --------------- | ------------------------- | -------------------------------------------------------- |\n| `components`    | `CalendarComponents`      | Custom components to replace default calendar elements.  |\n\n\n## Implementing a Custom Component\n\nPass the custom components to the `components` prop. Refer to the list below for available [custom components](#list-of-custom-components).\n\n```jsx\nimport DateTimePicker, {\n  CalendarDay,\n  CalendarMonth,\n  CalendarComponents,\n} from 'react-native-ui-datepicker';\n\nconst components: CalendarComponents = {\n  Day: (day: CalendarDay) => <YourCustomDay day={day} />,\n  Month: (month: CalendarMonth) => <YourCustomMonth month={month} />\n  // etc\n};\n\nexport function Calendar() {\n  return (\n      <DateTimePicker\n        components={components}\n      />\n  );\n}\n```\n\n## List of Custom Components\n\n| Name       | Type                                   | Description                                            |\n| ---------- | -------------------------------------- | ------------------------------------------------------ |\n| `Day`      | `(day: CalendarDay) => ReactNode`      | The component containing the day in the days grid.     |\n| `Month`    | `(month: CalendarMonth) => ReactNode`  | The component containing the month in the months grid. |\n| `Year`     | `(year: CalendarYear) => ReactNode`    | The component containing the year in the years grid.   |\n| `Weekday`  | `(weekday: CalendarWeek) => ReactNode` | The component containing the weekday in the header.    |\n| `IconPrev` | `ReactNode`                            | The previous month/year button icon in the header.     |\n| `IconNext` | `ReactNode`                            | The next month button/year icon in the header.         |\n\n## Type Definitions\n\n```typescript\ntype DateType = string | number | Dayjs | Date | null | undefined;\n\ntype CalendarMode = 'single' | 'range' | 'multiple';\n\ntype NavigationPosition = 'around' | 'right' | 'left';\n\ntype WeekdayFormat = 'min' | 'short' | 'full';\n\ntype MonthFormat = 'short' | 'full';\n\ntype CalendarDay = {\n  number: number;\n  text: string;\n  date: string;\n  isDisabled: boolean;\n  isCurrentMonth: boolean;\n  dayOfMonth?: number;\n  isToday: boolean;\n  isSelected: boolean;\n  inRange: boolean;\n  leftCrop: boolean;\n  rightCrop: boolean;\n  isStartOfWeek: boolean;\n  isEndOfWeek: boolean;\n  isCrop: boolean;\n  inMiddle: boolean;\n  rangeStart: boolean;\n  rangeEnd: boolean;\n};\n\ntype CalendarWeek = {\n  index: number;\n  name: {\n    full: string;\n    short: string;\n    min: string;\n  };\n};\n\ntype CalendarMonth = {\n  index: number;\n  name: {\n    full: string;\n    short: string;\n  };\n  isSelected: boolean;\n};\n\ntype CalendarYear = {\n  number: number;\n  text: string;\n  isSelected: boolean;\n  isActivated: boolean;\n};\n```\n\n## List of Numeral Systems\n\n| Name       | Description                                   |\n| ---------- | --------------------------------------------- |\n| `latn`     | Western Latin.                                |\n| `arab`     | Standard Arabic.                              |\n| `arabext`  | Eastern Arabic-Indic (Persian).               |\n| `deva`     | Devanagari, used in Indian languages.         |\n| `beng`     | Bengali, used in Bengali and Assamese.        |\n| `guru`     | Gurmukhi, used in Punjab, India.              |\n| `gujr`     | Gujarati, used in Gujarat, India.             |\n| `orya`     | Odia, used in Odisha, India.                  |\n| `tamldec`  | Tamil, used in Tamil-speaking regions.        |\n| `telu`     | Telugu, used in Andhra Pradesh and Telangana. |\n| `knda`     | Kannada, used in Karnataka, India.            |\n| `mlym`     | Malayalam, used in Kerala, India.             |\n\n<p align=\"center\">\n<img src=\"https://user-images.githubusercontent.com/7857656/227187674-93012672-495d-4955-b4d3-46c3d016684e.jpg\" alt=\"react-native-ui-datepicker\" />\n</p>\n\n## License\n\nMIT. See the [LICENSE](https://github.com/farhoudshapouran/react-native-ui-datepicker/blob/main/LICENSE) file for more details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a PR.\n","readmeFilename":"README.md","_rev":"1-2706810986f535657d5ea0b3a5676739"}