Skip to content

Commit 577aeed

Browse files
committedOct 19, 2023
fixing date bug
1 parent a7683fc commit 577aeed

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed
 

‎react/.storybook/preview.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "../../shared/styles/_main.scss";
1+
import "../../react/styles/_main.scss";
22

33
export const parameters = {
44
layout: "fullscreen",

‎react/components/DateField/DateField.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import { DatePicker } from "@mui/x-date-pickers/DatePicker";
55
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
66
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
77
import { kebabCase } from "lodash";
8+
import dayjs from 'dayjs'
9+
import utc from 'dayjs/plugin/utc';
810

11+
dayjs.extend(utc)
12+
dayjs.utc();
913
export const dateTextFieldStyle = {
1014
width: "170px",
1115
borderRadius: "3px",
@@ -64,9 +68,10 @@ const DateField = ({ label, value, handleDateChange, disabled }) => {
6468
{`${label}`}
6569
</InputLabel>
6670
<DatePicker
67-
value={value ? value : null}
71+
value={value ? dayjs.utc(value) : null}
6872
onChange={handleDateChange}
6973
disabled={disabled}
74+
views={["year", "day", "hours"]}
7075
slotProps={{
7176
textField: {
7277
id: "date",

‎react/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎react/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@madie/madie-design-system",
3-
"version": "1.0.58",
3+
"version": "1.0.59",
44
"description": "Shared style guide across the Madie program.",
55
"main": "dist/index.js",
66
"homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",
@@ -119,9 +119,9 @@
119119
"axios": "^0.24.0",
120120
"cookie": "^0.4.1",
121121
"cross-env": "^7.0.3",
122-
"dayjs": "^1.11.7",
123122
"d3-selection": "^1.4.2",
124123
"d3-shape": "^1.3.7",
124+
"dayjs": "^1.11.7",
125125
"jwt-decode": "^3.1.2",
126126
"preact": "^10.6.4",
127127
"prop-types": "^15.8.1",

0 commit comments

Comments
 (0)
Please sign in to comment.