File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed
android/src/main/java/com/reactcommunity/rndatetimepicker Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .reactcommunity .rndatetimepicker ;
2
+
3
+ public final class RNConstants {
4
+ public static final String ERROR_NO_ACTIVITY = "E_NO_ACTIVITY" ;
5
+ public static final String ARG_VALUE = "value" ;
6
+ public static final String ARG_MINDATE = "minimumDate" ;
7
+ public static final String ARG_MAXDATE = "maximumDate" ;
8
+ public static final String ARG_IS24HOUR = "is24Hour" ;
9
+ public static final String ARG_MODE = "mode" ;
10
+ public static final String ACTION_DATE_SET = "dateSetAction" ;
11
+ public static final String ACTION_TIME_SET = "timeSetAction" ;
12
+ public static final String ACTION_DISMISSED = "dismissedAction" ;
13
+
14
+ /**
15
+ * Minimum date supported by {@link DatePicker}, 01 Jan 1900
16
+ */
17
+ public static final long DEFAULT_MIN_DATE = -2208988800001l ;
18
+ }
Original file line number Diff line number Diff line change
1
+ package com .reactcommunity .rndatetimepicker ;
2
+
3
+ import java .util .Calendar ;
4
+ import android .os .Bundle ;
5
+
6
+ public class RNDate {
7
+ private Calendar now ;
8
+
9
+ public RNDate (Bundle args ) {
10
+ now = Calendar .getInstance ();
11
+
12
+ if (args != null && args .containsKey (RNConstants .ARG_VALUE )) {
13
+ set (args .getLong (RNConstants .ARG_VALUE ));
14
+ }
15
+ }
16
+
17
+ public void set (long value ) {
18
+ now .setTimeInMillis (value );
19
+ }
20
+
21
+ public int year () { return now .get (Calendar .YEAR ); }
22
+ public int month () { return now .get (Calendar .MONTH ); }
23
+ public int day () { return now .get (Calendar .DAY_OF_MONTH ); }
24
+ public int hour () { return now .get (Calendar .HOUR_OF_DAY ); }
25
+ public int minute () { return now .get (Calendar .MINUTE ); }
26
+ }
You can’t perform that action at this time.
0 commit comments