Skip to content

Commit e06008f

Browse files
author
Abbas
committed
first commit of source code
0 parents  commit e06008f

19 files changed

+761
-0
lines changed

DatePickerIOS.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
'use strict';
3+
import React, { Component } from 'react';
4+
import {
5+
StyleSheet,
6+
Text,
7+
View,
8+
NativeModules,
9+
requireNativeComponent,
10+
} from 'react-native';
11+
12+
const DatePickerIOS = React.createClass({
13+
propTypes: {
14+
date: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]),
15+
onChange: React.PropTypes.func,
16+
maximumDate: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]),
17+
minimumDate: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]),
18+
mode: React.PropTypes.oneOf(['date', 'time', 'datetime']),
19+
timeZoneOffsetInMinutes: React.PropTypes.number,
20+
dateFormat: React.PropTypes.string,
21+
calendar: React.PropTypes.string,
22+
},
23+
getDefaultProps: function () {
24+
return {
25+
mode: 'datetime',
26+
date: new Date().getTime(),
27+
dateFormat: "dd-MM-yyyy",
28+
calendar: "Gregorian"
29+
};
30+
},
31+
_onChange(event) {
32+
const timestamp = event.nativeEvent.timestamp;
33+
const date = event.nativeEvent.date;
34+
this.props.onChange && this.props.onChange({ date, timestamp });
35+
},
36+
render() {
37+
const props = this.props;
38+
return (
39+
<View style={props.style}>
40+
<RCTDatePickerIos
41+
mode={props.mode}
42+
calendar={props.calendar}
43+
onChange={this._onChange}
44+
date={props.date}
45+
maximumDate={props.maximumDate}
46+
minimumDate={props.minimumDate}
47+
dateFormat={props.dateFormat}
48+
style={styles.datePickerIOS}
49+
/>
50+
</View>
51+
);
52+
}
53+
});
54+
const styles = StyleSheet.create({
55+
datePickerIOS: {
56+
height: 216,
57+
},
58+
});
59+
60+
var RCTDatePickerIos = requireNativeComponent("RCTDatePickerIos", DatePickerIOS);
61+
module.exports = DatePickerIOS;
Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,287 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 46;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
E13A13931EA60A5100A6210A /* Datepicker.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E13A13921EA60A5100A6210A /* Datepicker.h */; };
11+
E13A13951EA60A5100A6210A /* Datepicker.m in Sources */ = {isa = PBXBuildFile; fileRef = E13A13941EA60A5100A6210A /* Datepicker.m */; };
12+
E13A13A51EA60A8C00A6210A /* RCTConvert+Calendar.m in Sources */ = {isa = PBXBuildFile; fileRef = E13A139C1EA60A8B00A6210A /* RCTConvert+Calendar.m */; };
13+
E13A13A61EA60A8C00A6210A /* RCTConvert+Date.m in Sources */ = {isa = PBXBuildFile; fileRef = E13A139E1EA60A8B00A6210A /* RCTConvert+Date.m */; };
14+
E13A13A71EA60A8C00A6210A /* RCTConvert+DatePickerMode.m in Sources */ = {isa = PBXBuildFile; fileRef = E13A13A01EA60A8B00A6210A /* RCTConvert+DatePickerMode.m */; };
15+
E13A13A81EA60A8C00A6210A /* RCTDatePickerIos.m in Sources */ = {isa = PBXBuildFile; fileRef = E13A13A21EA60A8B00A6210A /* RCTDatePickerIos.m */; };
16+
E13A13A91EA60A8C00A6210A /* UIDatePicker+OnChange.m in Sources */ = {isa = PBXBuildFile; fileRef = E13A13A41EA60A8B00A6210A /* UIDatePicker+OnChange.m */; };
17+
/* End PBXBuildFile section */
18+
19+
/* Begin PBXCopyFilesBuildPhase section */
20+
E13A138D1EA60A5100A6210A /* CopyFiles */ = {
21+
isa = PBXCopyFilesBuildPhase;
22+
buildActionMask = 2147483647;
23+
dstPath = "include/$(PRODUCT_NAME)";
24+
dstSubfolderSpec = 16;
25+
files = (
26+
E13A13931EA60A5100A6210A /* Datepicker.h in CopyFiles */,
27+
);
28+
runOnlyForDeploymentPostprocessing = 0;
29+
};
30+
/* End PBXCopyFilesBuildPhase section */
31+
32+
/* Begin PBXFileReference section */
33+
E13A138F1EA60A5100A6210A /* libDatepicker.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDatepicker.a; sourceTree = BUILT_PRODUCTS_DIR; };
34+
E13A13921EA60A5100A6210A /* Datepicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Datepicker.h; sourceTree = "<group>"; };
35+
E13A13941EA60A5100A6210A /* Datepicker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Datepicker.m; sourceTree = "<group>"; };
36+
E13A139B1EA60A8B00A6210A /* RCTConvert+Calendar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+Calendar.h"; sourceTree = "<group>"; };
37+
E13A139C1EA60A8B00A6210A /* RCTConvert+Calendar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+Calendar.m"; sourceTree = "<group>"; };
38+
E13A139D1EA60A8B00A6210A /* RCTConvert+Date.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+Date.h"; sourceTree = "<group>"; };
39+
E13A139E1EA60A8B00A6210A /* RCTConvert+Date.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+Date.m"; sourceTree = "<group>"; };
40+
E13A139F1EA60A8B00A6210A /* RCTConvert+DatePickerMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTConvert+DatePickerMode.h"; sourceTree = "<group>"; };
41+
E13A13A01EA60A8B00A6210A /* RCTConvert+DatePickerMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTConvert+DatePickerMode.m"; sourceTree = "<group>"; };
42+
E13A13A11EA60A8B00A6210A /* RCTDatePickerIos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDatePickerIos.h; sourceTree = "<group>"; };
43+
E13A13A21EA60A8B00A6210A /* RCTDatePickerIos.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDatePickerIos.m; sourceTree = "<group>"; };
44+
E13A13A31EA60A8B00A6210A /* UIDatePicker+OnChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDatePicker+OnChange.h"; sourceTree = "<group>"; };
45+
E13A13A41EA60A8B00A6210A /* UIDatePicker+OnChange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDatePicker+OnChange.m"; sourceTree = "<group>"; };
46+
/* End PBXFileReference section */
47+
48+
/* Begin PBXFrameworksBuildPhase section */
49+
E13A138C1EA60A5100A6210A /* Frameworks */ = {
50+
isa = PBXFrameworksBuildPhase;
51+
buildActionMask = 2147483647;
52+
files = (
53+
);
54+
runOnlyForDeploymentPostprocessing = 0;
55+
};
56+
/* End PBXFrameworksBuildPhase section */
57+
58+
/* Begin PBXGroup section */
59+
E13A13861EA60A5100A6210A = {
60+
isa = PBXGroup;
61+
children = (
62+
E13A13911EA60A5100A6210A /* Datepicker */,
63+
E13A13901EA60A5100A6210A /* Products */,
64+
);
65+
sourceTree = "<group>";
66+
};
67+
E13A13901EA60A5100A6210A /* Products */ = {
68+
isa = PBXGroup;
69+
children = (
70+
E13A138F1EA60A5100A6210A /* libDatepicker.a */,
71+
);
72+
name = Products;
73+
sourceTree = "<group>";
74+
};
75+
E13A13911EA60A5100A6210A /* Datepicker */ = {
76+
isa = PBXGroup;
77+
children = (
78+
E13A139B1EA60A8B00A6210A /* RCTConvert+Calendar.h */,
79+
E13A139C1EA60A8B00A6210A /* RCTConvert+Calendar.m */,
80+
E13A139D1EA60A8B00A6210A /* RCTConvert+Date.h */,
81+
E13A139E1EA60A8B00A6210A /* RCTConvert+Date.m */,
82+
E13A139F1EA60A8B00A6210A /* RCTConvert+DatePickerMode.h */,
83+
E13A13A01EA60A8B00A6210A /* RCTConvert+DatePickerMode.m */,
84+
E13A13A11EA60A8B00A6210A /* RCTDatePickerIos.h */,
85+
E13A13A21EA60A8B00A6210A /* RCTDatePickerIos.m */,
86+
E13A13A31EA60A8B00A6210A /* UIDatePicker+OnChange.h */,
87+
E13A13A41EA60A8B00A6210A /* UIDatePicker+OnChange.m */,
88+
E13A13921EA60A5100A6210A /* Datepicker.h */,
89+
E13A13941EA60A5100A6210A /* Datepicker.m */,
90+
);
91+
path = Datepicker;
92+
sourceTree = "<group>";
93+
};
94+
/* End PBXGroup section */
95+
96+
/* Begin PBXNativeTarget section */
97+
E13A138E1EA60A5100A6210A /* Datepicker */ = {
98+
isa = PBXNativeTarget;
99+
buildConfigurationList = E13A13981EA60A5100A6210A /* Build configuration list for PBXNativeTarget "Datepicker" */;
100+
buildPhases = (
101+
E13A138B1EA60A5100A6210A /* Sources */,
102+
E13A138C1EA60A5100A6210A /* Frameworks */,
103+
E13A138D1EA60A5100A6210A /* CopyFiles */,
104+
);
105+
buildRules = (
106+
);
107+
dependencies = (
108+
);
109+
name = Datepicker;
110+
productName = Datepicker;
111+
productReference = E13A138F1EA60A5100A6210A /* libDatepicker.a */;
112+
productType = "com.apple.product-type.library.static";
113+
};
114+
/* End PBXNativeTarget section */
115+
116+
/* Begin PBXProject section */
117+
E13A13871EA60A5100A6210A /* Project object */ = {
118+
isa = PBXProject;
119+
attributes = {
120+
LastUpgradeCheck = 0730;
121+
ORGANIZATIONNAME = CodeLab;
122+
TargetAttributes = {
123+
E13A138E1EA60A5100A6210A = {
124+
CreatedOnToolsVersion = 7.3.1;
125+
};
126+
};
127+
};
128+
buildConfigurationList = E13A138A1EA60A5100A6210A /* Build configuration list for PBXProject "Datepicker" */;
129+
compatibilityVersion = "Xcode 3.2";
130+
developmentRegion = English;
131+
hasScannedForEncodings = 0;
132+
knownRegions = (
133+
en,
134+
);
135+
mainGroup = E13A13861EA60A5100A6210A;
136+
productRefGroup = E13A13901EA60A5100A6210A /* Products */;
137+
projectDirPath = "";
138+
projectRoot = "";
139+
targets = (
140+
E13A138E1EA60A5100A6210A /* Datepicker */,
141+
);
142+
};
143+
/* End PBXProject section */
144+
145+
/* Begin PBXSourcesBuildPhase section */
146+
E13A138B1EA60A5100A6210A /* Sources */ = {
147+
isa = PBXSourcesBuildPhase;
148+
buildActionMask = 2147483647;
149+
files = (
150+
E13A13A71EA60A8C00A6210A /* RCTConvert+DatePickerMode.m in Sources */,
151+
E13A13951EA60A5100A6210A /* Datepicker.m in Sources */,
152+
E13A13A61EA60A8C00A6210A /* RCTConvert+Date.m in Sources */,
153+
E13A13A81EA60A8C00A6210A /* RCTDatePickerIos.m in Sources */,
154+
E13A13A91EA60A8C00A6210A /* UIDatePicker+OnChange.m in Sources */,
155+
E13A13A51EA60A8C00A6210A /* RCTConvert+Calendar.m in Sources */,
156+
);
157+
runOnlyForDeploymentPostprocessing = 0;
158+
};
159+
/* End PBXSourcesBuildPhase section */
160+
161+
/* Begin XCBuildConfiguration section */
162+
E13A13961EA60A5100A6210A /* Debug */ = {
163+
isa = XCBuildConfiguration;
164+
buildSettings = {
165+
ALWAYS_SEARCH_USER_PATHS = NO;
166+
CLANG_ANALYZER_NONNULL = YES;
167+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
168+
CLANG_CXX_LIBRARY = "libc++";
169+
CLANG_ENABLE_MODULES = YES;
170+
CLANG_ENABLE_OBJC_ARC = YES;
171+
CLANG_WARN_BOOL_CONVERSION = YES;
172+
CLANG_WARN_CONSTANT_CONVERSION = YES;
173+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
174+
CLANG_WARN_EMPTY_BODY = YES;
175+
CLANG_WARN_ENUM_CONVERSION = YES;
176+
CLANG_WARN_INT_CONVERSION = YES;
177+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
178+
CLANG_WARN_UNREACHABLE_CODE = YES;
179+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
180+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
181+
COPY_PHASE_STRIP = NO;
182+
DEBUG_INFORMATION_FORMAT = dwarf;
183+
ENABLE_STRICT_OBJC_MSGSEND = YES;
184+
ENABLE_TESTABILITY = YES;
185+
GCC_C_LANGUAGE_STANDARD = gnu99;
186+
GCC_DYNAMIC_NO_PIC = NO;
187+
GCC_NO_COMMON_BLOCKS = YES;
188+
GCC_OPTIMIZATION_LEVEL = 0;
189+
GCC_PREPROCESSOR_DEFINITIONS = (
190+
"DEBUG=1",
191+
"$(inherited)",
192+
);
193+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
194+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
195+
GCC_WARN_UNDECLARED_SELECTOR = YES;
196+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
197+
GCC_WARN_UNUSED_FUNCTION = YES;
198+
GCC_WARN_UNUSED_VARIABLE = YES;
199+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
200+
MTL_ENABLE_DEBUG_INFO = YES;
201+
ONLY_ACTIVE_ARCH = YES;
202+
SDKROOT = iphoneos;
203+
};
204+
name = Debug;
205+
};
206+
E13A13971EA60A5100A6210A /* Release */ = {
207+
isa = XCBuildConfiguration;
208+
buildSettings = {
209+
ALWAYS_SEARCH_USER_PATHS = NO;
210+
CLANG_ANALYZER_NONNULL = YES;
211+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
212+
CLANG_CXX_LIBRARY = "libc++";
213+
CLANG_ENABLE_MODULES = YES;
214+
CLANG_ENABLE_OBJC_ARC = YES;
215+
CLANG_WARN_BOOL_CONVERSION = YES;
216+
CLANG_WARN_CONSTANT_CONVERSION = YES;
217+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
218+
CLANG_WARN_EMPTY_BODY = YES;
219+
CLANG_WARN_ENUM_CONVERSION = YES;
220+
CLANG_WARN_INT_CONVERSION = YES;
221+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
222+
CLANG_WARN_UNREACHABLE_CODE = YES;
223+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
224+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
225+
COPY_PHASE_STRIP = NO;
226+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
227+
ENABLE_NS_ASSERTIONS = NO;
228+
ENABLE_STRICT_OBJC_MSGSEND = YES;
229+
GCC_C_LANGUAGE_STANDARD = gnu99;
230+
GCC_NO_COMMON_BLOCKS = YES;
231+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
232+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
233+
GCC_WARN_UNDECLARED_SELECTOR = YES;
234+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
235+
GCC_WARN_UNUSED_FUNCTION = YES;
236+
GCC_WARN_UNUSED_VARIABLE = YES;
237+
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
238+
MTL_ENABLE_DEBUG_INFO = NO;
239+
SDKROOT = iphoneos;
240+
VALIDATE_PRODUCT = YES;
241+
};
242+
name = Release;
243+
};
244+
E13A13991EA60A5100A6210A /* Debug */ = {
245+
isa = XCBuildConfiguration;
246+
buildSettings = {
247+
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**";
248+
OTHER_LDFLAGS = "-ObjC";
249+
PRODUCT_NAME = "$(TARGET_NAME)";
250+
SKIP_INSTALL = YES;
251+
};
252+
name = Debug;
253+
};
254+
E13A139A1EA60A5100A6210A /* Release */ = {
255+
isa = XCBuildConfiguration;
256+
buildSettings = {
257+
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**";
258+
OTHER_LDFLAGS = "-ObjC";
259+
PRODUCT_NAME = "$(TARGET_NAME)";
260+
SKIP_INSTALL = YES;
261+
};
262+
name = Release;
263+
};
264+
/* End XCBuildConfiguration section */
265+
266+
/* Begin XCConfigurationList section */
267+
E13A138A1EA60A5100A6210A /* Build configuration list for PBXProject "Datepicker" */ = {
268+
isa = XCConfigurationList;
269+
buildConfigurations = (
270+
E13A13961EA60A5100A6210A /* Debug */,
271+
E13A13971EA60A5100A6210A /* Release */,
272+
);
273+
defaultConfigurationIsVisible = 0;
274+
defaultConfigurationName = Release;
275+
};
276+
E13A13981EA60A5100A6210A /* Build configuration list for PBXNativeTarget "Datepicker" */ = {
277+
isa = XCConfigurationList;
278+
buildConfigurations = (
279+
E13A13991EA60A5100A6210A /* Debug */,
280+
E13A139A1EA60A5100A6210A /* Release */,
281+
);
282+
defaultConfigurationIsVisible = 0;
283+
};
284+
/* End XCConfigurationList section */
285+
};
286+
rootObject = E13A13871EA60A5100A6210A /* Project object */;
287+
}

Datepicker/Datepicker.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)