zavadil-react-common 1.2.98 → 1.2.99
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,7 @@
|
|
|
1
|
+
export type DateTimeInputProps = {
|
|
2
|
+
value?: Date | null;
|
|
3
|
+
onChange: (d: Date | undefined) => any;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function DateTimeInput({ value, onChange, disabled }: DateTimeInputProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default DateTimeInput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zavadil-react-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.99",
|
|
4
4
|
"description": "Common types for React Typescript UI apps.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"react-bootstrap": "^2.10.9",
|
|
33
33
|
"react-dom": "^18.2.0",
|
|
34
34
|
"react-icons": "^4.10.1",
|
|
35
|
-
"zavadil-ts-common": "^1.2.
|
|
35
|
+
"zavadil-ts-common": "^1.2.52"
|
|
36
36
|
},
|
|
37
37
|
"eslintConfig": {
|
|
38
38
|
"extends": [
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {DateUtil} from 'zavadil-ts-common';
|
|
2
|
+
import {Form} from "react-bootstrap";
|
|
3
|
+
|
|
4
|
+
export type DateTimeInputProps = {
|
|
5
|
+
value?: Date | null;
|
|
6
|
+
onChange: (d: Date | undefined) => any;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function DateTimeInput({value, onChange, disabled}: DateTimeInputProps) {
|
|
11
|
+
return (
|
|
12
|
+
<Form.Control
|
|
13
|
+
type="datetime-local"
|
|
14
|
+
disabled={disabled}
|
|
15
|
+
value={DateUtil.formatDateTimeForInput(value)}
|
|
16
|
+
onChange={(e) => {
|
|
17
|
+
onChange(DateUtil.parseDate(e.target.value));
|
|
18
|
+
}}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default DateTimeInput;
|