Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
50979b1
fix: selected rangle issue
aldiand May 13, 2024
7a1c3a7
Update Header.tsx - Fixing year.at(0) error on selecting the year in …
Andrews0406 May 16, 2024
e7d9364
fix: change timepicker bumped version to 2.0.3
farhoudshapouran May 26, 2024
214cb7d
fix : style on date in range
May 31, 2024
44199ca
Merge pull request #87 from aldiand/range-issue-patch
farhoudshapouran Jun 3, 2024
8a3aaab
Merge pull request #88 from Andrews0406/patch-1
farhoudshapouran Jun 3, 2024
57b80fd
fix : on selected date range part 2
Jun 3, 2024
d764f2c
fix : style on selected range when start and end is same
Jun 3, 2024
a147d3e
feat: add selected range background color prop
EliranSiboni Jun 5, 2024
ef298ac
fix: set min date as first date to show when available
EliranSiboni Jun 5, 2024
c036985
feat: add to docs
EliranSiboni Jun 5, 2024
e9d89f3
feat(disable): add props to allow custom date disabling
JHPG Jul 16, 2024
f5fc0a5
Merge pull request #94 from EliranSiboni/fix-set-min-date-as-first-da…
farhoudshapouran Jul 16, 2024
334bcf7
Merge pull request #93 from EliranSiboni/feat-add-selected-range-back…
farhoudshapouran Jul 16, 2024
3a1a728
docs(readme): include the new `isDateDisabled` prop
JHPG Jul 16, 2024
ddf3926
feat: add disabled dates list or callback prop
mitri-dvp Aug 2, 2024
75a6fc8
docs: add `disabledDates` prop
mitri-dvp Aug 2, 2024
1611e98
feat: add `isDateDisabled` utils function
mitri-dvp Aug 10, 2024
4abc1fb
Merge branch 'farhoudshapouran:main' into fix-style-on-selected-range
zdinidz Sep 10, 2024
be9df59
Merge pull request #92 from zdinidz/fix-style-on-selected-range
farhoudshapouran Sep 15, 2024
f2e47fb
Merge pull request #102 from mitri-dvp/main
farhoudshapouran Sep 15, 2024
e57cf0e
Merge branch 'main' into feat/is-date-disabled
farhoudshapouran Sep 15, 2024
4c7cacd
Merge pull request #99 from JHPG/feat/is-date-disabled
farhoudshapouran Sep 15, 2024
a9da6c8
fix: conflicts and linting
farhoudshapouran Sep 15, 2024
bd0cea9
chore: update dependencies bumped version to 2.0.4
farhoudshapouran Sep 15, 2024
744a320
Update TimeSelector.tsx
neriyaco Nov 24, 2024
e6b839e
Merge pull request #131 from neriyaco/patch-1
farhoudshapouran Jan 6, 2025
fa35979
chore: update example
farhoudshapouran Jan 6, 2025
5754276
fix: time picker initial value problem, locale problem and improve pe…
farhoudshapouran Feb 1, 2025
b9569cc
fix: time picker issue on android
farhoudshapouran Feb 1, 2025
7369a8f
fix: calendar day opacity for range mode (#124)
farhoudshapouran Feb 1, 2025
503b2f8
chore: bump version to 2.0.7
farhoudshapouran Feb 1, 2025
80fc491
chore: add gh-pages to deploy example
farhoudshapouran Feb 1, 2025
4c6865e
fix: remove unnecessary declarations file (#138)
farhoudshapouran Feb 1, 2025
bfff1c5
chore: bump to v2.0.8
farhoudshapouran Feb 1, 2025
a15f5b5
fix: types
farhoudshapouran Feb 1, 2025
ebc7c57
chore: bump to v2.0.10
farhoudshapouran Feb 1, 2025
469431b
chore: fix ci workflow
farhoudshapouran Feb 2, 2025
6830f8a
fix: update node version
farhoudshapouran Feb 2, 2025
3c85823
fix: update resolutions
farhoudshapouran Feb 2, 2025
4ffd3c7
fix: ensure node 18 in GitHub Actions
farhoudshapouran Feb 2, 2025
79b4499
fix: force node.js 18 in GitHub Actions
farhoudshapouran Feb 2, 2025
d1b0a4d
fix: update tests
farhoudshapouran Feb 2, 2025
9e86ad8
fix: disabled days style
farhoudshapouran Feb 3, 2025
10bc9d0
chore: bump version to 2.0.11
farhoudshapouran Feb 3, 2025
c2cac49
feat: add renderDay prop
farhoudshapouran Feb 5, 2025
26ff3c8
feat: add nativewind
farhoudshapouran Feb 6, 2025
36e04b3
fix: resolve 'React is not defined' error
GnuPixie Feb 6, 2025
674e51f
Merge pull request #142 from GnuPixie/main
farhoudshapouran Feb 8, 2025
e045669
feat: add new styles and classnames
farhoudshapouran Feb 10, 2025
bac0966
refactor: components names
farhoudshapouran Feb 11, 2025
9343f3f
refactor: components and styles
farhoudshapouran Feb 12, 2025
da1e0a0
feat: add month and year custom components
farhoudshapouran Feb 13, 2025
9e3ecd0
refactor: custom components
farhoudshapouran Feb 14, 2025
b6107b3
feat: add onMonthChange and onYearChange methods
farhoudshapouran Feb 14, 2025
d66bd10
feat: add timezone
farhoudshapouran Feb 15, 2025
82c8d83
fix: add polyfill to support timezone in react-native
farhoudshapouran Feb 15, 2025
90affdb
feat: add min and max props to limit the number of selectable dates
farhoudshapouran Feb 15, 2025
2d9bb8d
feat: add numerals props
farhoudshapouran Feb 16, 2025
f115b16
docs: update readme
farhoudshapouran Feb 16, 2025
2c9f294
docs: update readme
farhoudshapouran Feb 16, 2025
385cb0b
docs: update readme
farhoudshapouran Feb 16, 2025
9075a0a
docs: update readme
farhoudshapouran Feb 16, 2025
5031fe0
docs: update readme
farhoudshapouran Feb 16, 2025
52be297
docs: update readme
farhoudshapouran Feb 16, 2025
d81bacf
fix: time picker initial value
farhoudshapouran Feb 16, 2025
fc3d027
fix: styles and time picker issues
farhoudshapouran Feb 17, 2025
1f56350
docs: update readme
farhoudshapouran Feb 17, 2025
9df7e7b
docs: add examples
farhoudshapouran Feb 17, 2025
4bb7134
chore: bump version to 3.0.0
farhoudshapouran Feb 17, 2025
1445203
chore: bump version to 2.0.12
farhoudshapouran Feb 17, 2025
f5c1b7f
fix: tsconfig
farhoudshapouran Feb 17, 2025
fd6246c
Merge branch 'v3'
farhoudshapouran Feb 17, 2025
b9f3e29
fix: demo application
farhoudshapouran Feb 17, 2025
a8b438d
fix: rename files
farhoudshapouran Feb 17, 2025
3d19683
Delete src/components/Header directory
farhoudshapouran Feb 17, 2025
46f734e
Merge pull request #145 from farhoudshapouran/farhoudshapouran-patch-3
farhoudshapouran Feb 17, 2025
51488ef
Delete src/components/Calendar.tsx
farhoudshapouran Feb 17, 2025
d568152
Merge pull request #146 from farhoudshapouran/farhoudshapouran-patch-4
farhoudshapouran Feb 17, 2025
f0e57c7
Delete src/components/Day.tsx
farhoudshapouran Feb 17, 2025
096529b
Merge pull request #147 from farhoudshapouran/farhoudshapouran-patch-5
farhoudshapouran Feb 17, 2025
07e26b0
Delete src/components/Days.tsx
farhoudshapouran Feb 17, 2025
a5efaf7
Merge pull request #148 from farhoudshapouran/farhoudshapouran-patch-6
farhoudshapouran Feb 17, 2025
8d6db99
Delete src/components/WeekDays.tsx
farhoudshapouran Feb 17, 2025
7d2e9a7
Merge pull request #149 from farhoudshapouran/farhoudshapouran-patch-7
farhoudshapouran Feb 17, 2025
ce2659c
Delete src/components/Months.tsx
farhoudshapouran Feb 17, 2025
156e135
Merge pull request #150 from farhoudshapouran/farhoudshapouran-patch-8
farhoudshapouran Feb 17, 2025
196152b
fix: rename files
farhoudshapouran Feb 17, 2025
894eda0
Merge pull request #151 from farhoudshapouran/farhoudshapouran-patch-9
farhoudshapouran Feb 17, 2025
2041aae
fix: set current date based on selected date changes
farhoudshapouran Feb 18, 2025
2ab3f84
chore: bump version to 3.0.1
farhoudshapouran Feb 18, 2025
909b82a
Merge pull request #152 from farhoudshapouran/v3
farhoudshapouran Feb 18, 2025
03111d1
fix: resolve 'React is not defined' error
farhoudshapouran Feb 18, 2025
f48e16c
chore: bump version to 3.0.2
farhoudshapouran Feb 18, 2025
fb18bfb
Merge pull request #153 from farhoudshapouran/v3
farhoudshapouran Feb 18, 2025
9550d81
Update README.md
farhoudshapouran Feb 18, 2025
10cc30d
fix: misspelled typo in props
farhoudshapouran Feb 19, 2025
56903f4
fix: change return values of onChange to javascript Date object
farhoudshapouran Feb 19, 2025
f464505
fix: /lib/commonjs/index not found error
farhoudshapouran Feb 19, 2025
f3b5d1b
chore: bump version to 3.0.3
farhoudshapouran Feb 19, 2025
282d132
feat: isYearDisabled, isMonthDisabled
mystica2000 Feb 6, 2025
398ae6a
Merge pull request #140 from mystica2000/feat/disable-month-year-sele…
farhoudshapouran Feb 20, 2025
f560989
chore: bump version to 3.0.4
farhoudshapouran Feb 20, 2025
82db26d
fix: github workflow
farhoudshapouran Feb 20, 2025
a8c750e
style: fix Prettier formatting
farhoudshapouran Feb 20, 2025
faaae2a
docs: update examples
farhoudshapouran Feb 20, 2025
d1c9531
fix: remove unnecessary logs
farhoudshapouran Feb 20, 2025
c61d5bc
fix: remove accessibilityRole from header component
farhoudshapouran Feb 20, 2025
3072faa
test: update snapshot test
farhoudshapouran Feb 20, 2025
2dc23a4
Add files via upload
farhoudshapouran Feb 20, 2025
465e1cf
Update README.md
farhoudshapouran Feb 20, 2025
63d98d6
Update README.md
farhoudshapouran Feb 20, 2025
265d3e7
Update README.md
farhoudshapouran Feb 20, 2025
dfc8813
feat: add 12 hour functionality
farhoudshapouran Feb 25, 2025
0f39c75
feat: enabledDates
Cominis Mar 1, 2025
3485fc4
refactor: time picker
farhoudshapouran Mar 2, 2025
fde4ec8
docs: update readme
farhoudshapouran Mar 2, 2025
1d10229
Merge pull request #166 from farhoudshapouran/feat/12-hour-format
farhoudshapouran Mar 2, 2025
f3706af
chore: bump version to 3.0.5
farhoudshapouran Mar 2, 2025
97c9661
Create FUNDING.yml
farhoudshapouran Mar 4, 2025
d47a9e5
Update FUNDING.yml
farhoudshapouran Mar 4, 2025
433807d
Update FUNDING.yml
farhoudshapouran Mar 4, 2025
4760c6e
fix: remove default root style
farhoudshapouran Mar 9, 2025
73d1be4
fix: day cell width consistency
farhoudshapouran Mar 9, 2025
2f2136f
fix: change day cell style to fit better
farhoudshapouran Mar 9, 2025
4773365
fix: resolve date range selection logic issues in multiple mode
farhoudshapouran Mar 9, 2025
490f431
Merge pull request #173 from farhoudshapouran/fix/range-issues
farhoudshapouran Mar 9, 2025
3e43300
feat: add example project
farhoudshapouran Mar 9, 2025
c4725b7
chore: bump version to 3.0.6
farhoudshapouran Mar 9, 2025
3ae0107
test: update snapshots
farhoudshapouran Mar 9, 2025
bb2ede2
Merge pull request #164 from Cominis/enhancement/add_enabledDates
farhoudshapouran Mar 9, 2025
13eb3c6
fix: renamed defaut styles and classNames as hooks. closes #160
farhoudshapouran Mar 9, 2025
ad2e607
feat: allow picking the color scheme for the useDefaultStyles functio…
farhoudshapouran Mar 9, 2025
f16915e
feat: add option to style next and prev buttons image icon. closes #155
farhoudshapouran Mar 9, 2025
bce1cf0
test: snapshots updated
farhoudshapouran Mar 9, 2025
81ca66c
Merge pull request #174 from farhoudshapouran/fix/styling-issues
farhoudshapouran Mar 9, 2025
268a905
chore: bump version to 3.0.7
farhoudshapouran Mar 9, 2025
2cabe2f
fix: resolve 'React is not defined' error
kingsley-eneris Mar 14, 2025
0504a9f
Merge pull request #176 from kingsley-eneris/main
farhoudshapouran Mar 19, 2025
a4a6a21
feat: add jalali plugin
farhoudshapouran Mar 19, 2025
4f69764
docs: add calendar prop
farhoudshapouran Mar 19, 2025
c0b6dfb
test: update snapshots
farhoudshapouran Mar 19, 2025
ff8565b
Merge pull request #177 from farhoudshapouran/jalali-calendar
farhoudshapouran Mar 19, 2025
64c0956
chore: bump version to 3.1.0 (add jalali calendar)
farhoudshapouran Mar 19, 2025
9a00042
fix: property 'React' doesn't exist error
farhoudshapouran Mar 20, 2025
ea72883
fix: library TypeScript type declarations
farhoudshapouran Mar 20, 2025
47f8d32
feat: additions for v3
Apr 23, 2025
37df9b0
fix: add missing timezone information for days grid generation
Apr 24, 2025
304c873
fix: constrain maxDate to selected timezone
Apr 24, 2025
9b581a2
Revert "fix: add missing timezone information for days grid generation"
Apr 24, 2025
9da6e67
Revert "fix: constrain maxDate to selected timezone"
Apr 24, 2025
f38cebb
fix: timezone propagation for days grid
Apr 24, 2025
22f1ed7
Revert "fix: timezone propagation for days grid"
Apr 24, 2025
63ee2ff
fix: second support without re-zoning
Apr 28, 2025
da96612
fix: getStartOfTimezonedDay function
May 7, 2025
505dd5e
fix: onSelectedDate correct timezone computation
May 7, 2025
6fa3404
fix: used date instead of selectedDate
May 7, 2025
766f933
fix: tie day grid generation to timezone
May 7, 2025
e4f2bc1
Revert "fix: tie day grid generation to timezone"
May 7, 2025
f13f92f
Revert "fix: used date instead of selectedDate"
May 7, 2025
1d75295
Revert "fix: onSelectedDate correct timezone computation"
May 7, 2025
51f611e
Revert "fix: getStartOfTimezonedDay function"
May 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintrc.json

This file was deleted.

4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [farhoudshapouran]
buy_me_a_coffee: farhoudshapouran
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
node-version: 18 # Force Node.js 18 instead of using .nvmrc

- name: Cache dependencies
id: yarn-cache
Expand Down
Binary file added .github/images/rnui-datepicker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 24 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,42 @@ on:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# disabled because the latest eslint version "ignores" option does not work as expected
# lint:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup
# - name: Setup project
# uses: ./.github/actions/setup

- name: Lint files
run: yarn lint
# - name: Lint files
# run: yarn lint

- name: Typecheck files
run: yarn typecheck
# - name: Typecheck files
# run: yarn typecheck

test:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup
- name: Setup project
uses: ./.github/actions/setup

- name: Run unit tests
run: yarn test --maxWorkers=2 --coverage
run: yarn test

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup
# - name: Setup project
# uses: ./.github/actions/setup

- name: Build package
run: yarn prepack
# - name: Build package
# run: yarn prepack
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ android.iml

# Cocoapods
#
demo/ios/Pods
example/ios/Pods

# Ruby
demo/vendor/
example/vendor/

# node.js
Expand All @@ -67,7 +69,7 @@ android/keystores/debug.keystore
.turbo/

# generated by bob
lib/
/lib/

.env
web-build
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"quoteProps": "consistent",
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"useTabs": false,
"plugins": ["prettier-plugin-tailwindcss"]
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2023 Farhood Shapouran
Copyright (c) 2025 Farhoud Shapouran

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
412 changes: 323 additions & 89 deletions README.md

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/
expo-env.d.ts

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

app-example
50 changes: 50 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Welcome to your Expo app 👋

This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).

## Get started

1. Install dependencies

```bash
npm install
```

2. Start the app

```bash
npx expo start
```

In the output, you'll find options to open the app in a

- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo

You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).

## Get a fresh project

When you're ready, run:

```bash
npm run reset-project
```

This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.

## Learn more

To learn more about developing your project with Expo, look at the following resources:

- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.

## Join the community

Join our community of developers creating universal apps.

- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
47 changes: 47 additions & 0 deletions demo/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"expo": {
"name": "React Native UI DatePicker Demo",
"slug": "react-native-ui-datepicker-demo",
"description": "Customizable React Native DateTime Picker component for Android, iOS, and Web. It includes date, time, and datetime modes and supports different locales.",
"version": "1.0.0",
"githubUrl": "https://github.com/farhoudshapouran/react-native-ui-datepicker",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"userInterfaceStyle": "automatic",
"supportsTablet": true
},
"android": {
"userInterfaceStyle": "automatic",
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
}
},
"web": {
"bundler": "metro",
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": [
"expo-router",
[
"expo-splash-screen",
{
"image": "./assets/images/splash-icon.png",
"imageWidth": 200,
"resizeMode": "contain",
"backgroundColor": "#ffffff"
}
],
"expo-font"
],
"experiments": {
"typedRoutes": true,
"baseUrl": "/react-native-ui-datepicker"
}
}
}
30 changes: 30 additions & 0 deletions demo/app/+html.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ScrollViewStyleReset } from 'expo-router/html';
import type { PropsWithChildren } from 'react';

// This file is web-only and used to configure the root HTML for every
// web page during static rendering.
// The contents of this function only run in Node.js environments and
// do not have access to the DOM or browser APIs.
export default function Root({ children }: PropsWithChildren) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>

{/*
Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line.
*/}
<ScrollViewStyleReset />

{/* Add any additional <head> elements that you want globally available on web... */}
</head>
<body>{children}</body>
</html>
);
}
30 changes: 30 additions & 0 deletions demo/app/+not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';
import { Link, Stack } from 'expo-router';
import { StyleSheet, View, Text } from 'react-native';

export default function NotFoundScreen() {
return (
<>
<Stack.Screen options={{ title: 'Oops!' }} />
<View style={styles.container}>
<Text>This screen doesn't exist.</Text>
<Link href="/" style={styles.link}>
<Text>Go to home screen!</Text>
</Link>
</View>
</>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 20,
},
link: {
marginTop: 15,
paddingVertical: 15,
},
});
Loading