Skip to content

Combined date and time picker from react-native core #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 78 commits into from
May 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
8577b6f
first commit
cpojer Feb 15, 2019
c50673d
[initial] npm init and add license
Feb 28, 2019
be9bb58
[minor] add eslint and setup jest
Feb 28, 2019
1198405
[minor] add flow
Feb 28, 2019
22c0a1d
[minor] add initialized example app
Mar 4, 2019
19c1e81
[major] setup expo example app
Mar 5, 2019
e357829
[fix] everything is fine, suddenly it works...
Mar 5, 2019
f984c0d
[minor] working example from ported code
Mar 5, 2019
4a92d7f
[fix] dont use expo, no native support
Mar 6, 2019
7cbb259
[major] move native code and rename to RNDateTimePicker
Mar 7, 2019
978e881
[fix] import React libraries the correct way
Mar 7, 2019
767580e
[tiny] change example code
Mar 7, 2019
c2824ff
[test] fix resolver and unit test
Mar 7, 2019
bd887f8
[test] add more assertions
Mar 7, 2019
1500887
[fix] remove default state from example
Mar 8, 2019
498c7f0
[fix] remove eof
Mar 8, 2019
468b0f6
[dist] restrict peerDeps
Mar 8, 2019
90fb9d1
[fix] comment
Mar 8, 2019
02fb899
[test] assert other modes are passed
Mar 8, 2019
405b216
[fix] destruct all props
Mar 8, 2019
7467ee9
Merge pull request #1 from react-native-community/initial
Swaagie Mar 8, 2019
a54c597
[iOS] Fixed minuteInterval invalid in time mode
zhongwuzw Mar 15, 2019
e5b9917
Merge pull request #2 from zhongwuzw/fix_time_minuteInterval
Swaagie Mar 20, 2019
b67cfaa
[initial] start android work
Mar 22, 2019
27d2fc3
[major] js code for android
Mar 27, 2019
ec2d1d7
[minor] setup java module files
Mar 27, 2019
96649e8
[minor] make it build, sort of
Apr 1, 2019
aa6869a
[fix] add files
Apr 1, 2019
28a7e3c
[fix] build issues
Apr 2, 2019
2b554eb
[tiny] update gradle
Apr 2, 2019
f1504cf
[major] migrate time picker
Apr 3, 2019
ae59ae7
[fix] add missing files
Apr 3, 2019
9b20fc8
[minor] ensure android and ios work
Apr 3, 2019
201a68e
[minor] update date after rerender
Apr 8, 2019
dde96db
[test] fix snapshots, test constants and utils
Apr 8, 2019
432ad85
[fix] add files
Apr 8, 2019
5134f08
[minor] ensure timepicker can be updated
Apr 9, 2019
0694af7
[fix] add missing files
Apr 9, 2019
6822cbc
[test] onChange
Apr 9, 2019
e879835
[fix] assert against date argument
Apr 9, 2019
f818fc6
[fix] check Date through `Object.toString`
Apr 10, 2019
170d802
[major] flow checks working and semi integrated
Apr 11, 2019
5a4f00e
[fix] allow Date to be optional
Apr 23, 2019
09aa937
Merge pull request #4 from react-native-community/flow
Swaagie Apr 23, 2019
bcd17b1
[fix] remove type coercion
Apr 23, 2019
bc34969
Merge pull request #3 from react-native-community/android
Swaagie Apr 23, 2019
506872f
[minor] setup first circleci config based on RN orb
Apr 23, 2019
a411a24
[fix] define workflow
Apr 23, 2019
4c7930e
[fix] supply timestamp to prevent ambiguity around timezone
Apr 23, 2019
8ae0d2a
[doc] add circleci badge
Apr 23, 2019
40f68d3
[minor] attempt to do android/ios build
Apr 23, 2019
914bd1d
[fix] remove defaults
Apr 23, 2019
e16ca29
[fix] explicitly define jobs?
Apr 23, 2019
b46cc28
[fix] ignore ios for now
Apr 23, 2019
91fd1c9
[fix] install example
Apr 23, 2019
b2d7968
[fix] define job
Apr 23, 2019
0b0dc20
[fix] attach at example root
Apr 23, 2019
4736910
[fix] require checkout
Apr 23, 2019
0fcfa5f
[fix] only use workspace_root
Apr 23, 2019
dd047e3
[fix] use defaults
Apr 23, 2019
5e50df3
[fix] use string
Apr 23, 2019
0bd6926
[fix] kill cache?
Apr 23, 2019
04dea08
list the damm entries
Apr 23, 2019
9ce77c0
[fix] workspace_root is not what it should be
Apr 23, 2019
8ee03b5
list example
Apr 23, 2019
fe71acd
rel path
Apr 23, 2019
063d671
[fix] wrong dir order
Apr 24, 2019
8d16a10
[tiny] provide install job for example
Apr 24, 2019
de53dd0
[fix] yaml indent
Apr 24, 2019
2311c0e
[fix] add job to workflow
Apr 24, 2019
c82d183
[fix] separate install
Apr 24, 2019
59f26ee
[tiny] switch to use npm
Apr 24, 2019
09f7b4a
[fix] run install
Apr 24, 2019
a1a53f2
[fix] persist install
Apr 24, 2019
0c3431b
[fix] add gradle task
Apr 24, 2019
3c9a62b
Merge pull request #7 from react-native-community/circleci
Swaagie Apr 24, 2019
571788e
Merge branch 'master' of github.com:react-native-community/react-nati…
May 17, 2019
8fcce11
Merge branch 'master' into review
May 17, 2019
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
68 changes: 68 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: 2.1

orbs:
rn: react-native-community/react-native@dev:0.1.0-rc14

jobs:
checkout_code:
executor: rn/linux_js
steps:
- checkout
- persist_to_workspace:
root: .
paths: .

install_example:
executor: rn/linux_js
steps:
- attach_workspace:
at: .
- run:
name: Install example
command: npm run install:example
- persist_to_workspace:
root: .
paths: .

analyse:
executor: rn/linux_js
steps:
- attach_workspace:
at: .
- run:
name: Install
command: npm ci
- run:
name: Lint JS Code (ESLint)
command: npm run lint
- run:
name: Flow
command: npm run flow
- run:
name: Jest
command: npm run test

workflows:
test:
jobs:
- checkout_code
- analyse:
requires:
- checkout_code
- install_example:
requires:
- checkout_code
- rn/android_build:
project_path: "example/android"
name: build_android_debug
requires:
- install_example

# Add Detox tests before running this expensive job.
# - rn/ios_build_and_test:
# project_path: "example/ios/example.xcodeproj"
# device: "iPhone X"
# build_configuration: "Debug"
# scheme: "Example"
# requires:
# - analyse
279 changes: 279 additions & 0 deletions .eslintrc.js

Large diffs are not rendered by default.

106 changes: 106 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[ignore]
; This flowconfig is forked by platform - the only difference between them is which suffix is ignored.
.*/*[.]android.js

; Ignore templates for 'react-native init'
.*/local-cli/templates/.*

; Ignore the Dangerfile
node_modules/react-native/bots/dangerfile.js

; Ignore "BUCK" generated dirs
node_modules/react-native/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js

; Ignore polyfills
.*/Libraries/polyfills/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/invariant')
.*/node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/HMRLoadingView.js

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.ios.js
module.file_ext=.js
module.system=haste
module.system.haste.use_name_reducers=true
# keep the following in sync with server/haste/hasteImpl.js
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip platform suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/react-native/react-native-implementation.js

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_android\\)?_oss|react_native\\(_android\\)?_fb][a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*[react_native\\(_android\\)?_oss|react_native\\(_android\\)?_fb][a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
deprecated-call-syntax=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.95.0
106 changes: 106 additions & 0 deletions .flowconfig.android
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
[ignore]
; We fork some components by platform
.*/*[.]ios.js

; Ignore templates for 'react-native init'
.*/local-cli/templates/.*

; Ignore the Dangerfile
node_modules/react-native/bots/dangerfile.js

; Ignore "BUCK" generated dirs
node_modules/react-native/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js

; Ignore polyfills
.*/Libraries/polyfills/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
.*/node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/HMRLoadingView.js

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.android.js
module.file_ext=.js
module.system=haste
module.system.haste.use_name_reducers=true
# keep the following in sync with server/haste/hasteImpl.js
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .android suffix
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/Libraries/react-native/react-native-implementation.js

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_android\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_android\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
deprecated-call-syntax=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.95.0
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# OSX
#
.DS_Store

# node.js
#
node_modules/
npm-debug.log
yarn-error.log


# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace


# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml

# BUCK
buck-out/
\.buckd/
*.keystore

# Editor config
.vscode

21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 React Native Community

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
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# react-native-datepicker
# React Native DateTimePicker

[![CircleCI](https://circleci.com/gh/react-native-community/react-native-datetimepicker.svg?style=svg)](https://circleci.com/gh/react-native-community/react-native-datetimepicker)
19 changes: 19 additions & 0 deletions RNDateTimePicker.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = "RNDateTimePicker"
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.author = package['author']
s.homepage = package['homepage']
s.platform = :ios, "10.0"
s.source = { :git => "https://github.com/react-native-community/react-native-datetimepicker", :tag => "master" }
s.source_files = "ios/*.{h,m}"
s.requires_arc = true

s.dependency "React"
end
Loading