@hitesh0009/react-native-datetime-picker 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ import { Items } from "../types";
2
+
3
+ export const Month_name: Items[] = [
4
+ { key: 0, id: 1, fullName: "January", shortName: "Jan" },
5
+ { key: 1, id: 2, fullName: "February", shortName: "Feb" },
6
+ { key: 2, id: 3, fullName: "March", shortName: "Mar" },
7
+ { key: 3, id: 4, fullName: "April", shortName: "Apr" },
8
+ { key: 4, id: 5, fullName: "May", shortName: "May" },
9
+ { key: 5, id: 6, fullName: "June", shortName: "Jun" },
10
+ { key: 6, id: 7, fullName: "July", shortName: "Jul" },
11
+ { key: 7, id: 8, fullName: "August", shortName: "Aug" },
12
+ { key: 8, id: 9, fullName: "September", shortName: "Sep" },
13
+ { key: 9, id: 10, fullName: "October", shortName: "Oct" },
14
+ { key: 10, id: 11, fullName: "November", shortName: "Nov" },
15
+ { key: 11, id: 12, fullName: "December", shortName: "Dec" },
16
+ ];
17
+ export const Week_name: Items[] = [
18
+ { key: 0, id: 1, fullName: "Sunday", shortName: "Sun" },
19
+ { key: 2, id: 2, fullName: "Monday", shortName: "Mon" },
20
+ { key: 3, id: 3, fullName: "Tuesday", shortName: "Tue" },
21
+ { key: 4, id: 4, fullName: "Wednesday", shortName: "Wed" },
22
+ { key: 5, id: 5, fullName: "Thursday", shortName: "Thu" },
23
+ { key: 6, id: 6, fullName: "Friday", shortName: "Fri" },
24
+ { key: 7, id: 7, fullName: "Saturday", shortName: "Sat" },
25
+ ];
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ export { DateTimePicker } from "./DataTimePicker";
2
+
3
+ export {
4
+ DateTimePickerProps,
5
+ DateTimeFormat,
6
+ Items,
7
+ WheelProps,
8
+ WheelTypes,
9
+ } from "./types";
package/src/types.ts ADDED
@@ -0,0 +1,59 @@
1
+ import { TextStyle, ViewStyle } from "react-native";
2
+
3
+ export type Items = {
4
+ key: number;
5
+ id: number;
6
+ shortName: string;
7
+ fullName: string;
8
+ };
9
+
10
+ export type DateTimeFormat = {
11
+ day?: "numeric" | "alphabetical";
12
+ month?: "numeric" | "alphabeticalShort" | "alphabeticalLong";
13
+ year?: "short" | "long";
14
+ timeFormat?: 24 | 12;
15
+ hours?: "hh" | "h";
16
+ minutes?: "mm" | "m";
17
+ };
18
+
19
+ export interface DateTimePickerProps {
20
+ start?: Date;
21
+ end?: Date;
22
+ initial: Date;
23
+
24
+ selectorContainerStyle?: ViewStyle;
25
+ textSizeActive?: TextStyle["fontSize"];
26
+ textSizeInActive?: TextStyle["fontSize"];
27
+ textWeightActive?: TextStyle["fontWeight"];
28
+ textWeightInActive?: TextStyle["fontWeight"];
29
+ fontFamily?: string;
30
+ height?: number;
31
+ numRows?: number;
32
+
33
+ onChange?: (date: Date) => void;
34
+ format?: DateTimeFormat;
35
+ }
36
+
37
+ export type WheelTypes = "day" | "month" | "year" | "hours" | "minutes";
38
+
39
+ export interface WheelProps<T = number | string> {
40
+ data: T[];
41
+ onChange: (value: T) => void;
42
+ value: T;
43
+ height: number;
44
+ numRows: number;
45
+ centerItem: number;
46
+
47
+ type?: WheelTypes;
48
+ textSizeActive?: number;
49
+ textSizeInActive?: number;
50
+ textWeightActive?: TextStyle["fontWeight"];
51
+ textWeightInActive?: TextStyle["fontWeight"];
52
+ fontFamily?: TextStyle["fontFamily"];
53
+ repeat?: boolean;
54
+ format?: DateTimeFormat;
55
+ year?: number;
56
+ month?: number;
57
+ minDate?: Date;
58
+ maxDate?: Date;
59
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2019",
4
+ "module": "ESNext",
5
+ "lib": ["ES2019"],
6
+ "jsx": "react-jsx",
7
+
8
+ "rootDir": "./src",
9
+ "outDir": "./dist",
10
+
11
+ "declaration": true,
12
+ "declarationMap": true,
13
+
14
+ "strict": true,
15
+ "skipLibCheck": true,
16
+
17
+ "moduleResolution": "node",
18
+ "esModuleInterop": true,
19
+ "allowSyntheticDefaultImports": true,
20
+
21
+ "resolveJsonModule": true,
22
+ "forceConsistentCasingInFileNames": true
23
+ },
24
+ "include": ["src"],
25
+ "exclude": ["node_modules", "dist"]
26
+ }