Skip to content

Commit

Permalink
fixing date bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sb-prateekkeerthi committed Oct 19, 2023
1 parent a7683fc commit 577aeed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion react/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "../../shared/styles/_main.scss";
import "../../react/styles/_main.scss";

export const parameters = {
layout: "fullscreen",
Expand Down
7 changes: 6 additions & 1 deletion react/components/DateField/DateField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { DatePicker } from "@mui/x-date-pickers/DatePicker";
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import { kebabCase } from "lodash";
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc';

dayjs.extend(utc)
dayjs.utc();
export const dateTextFieldStyle = {
width: "170px",
borderRadius: "3px",
Expand Down Expand Up @@ -64,9 +68,10 @@ const DateField = ({ label, value, handleDateChange, disabled }) => {
{`${label}`}
</InputLabel>
<DatePicker
value={value ? value : null}
value={value ? dayjs.utc(value) : null}
onChange={handleDateChange}
disabled={disabled}
views={["year", "day", "hours"]}
slotProps={{
textField: {
id: "date",
Expand Down
4 changes: 2 additions & 2 deletions react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@madie/madie-design-system",
"version": "1.0.58",
"version": "1.0.59",
"description": "Shared style guide across the Madie program.",
"main": "dist/index.js",
"homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",
Expand Down Expand Up @@ -119,9 +119,9 @@
"axios": "^0.24.0",
"cookie": "^0.4.1",
"cross-env": "^7.0.3",
"dayjs": "^1.11.7",
"d3-selection": "^1.4.2",
"d3-shape": "^1.3.7",
"dayjs": "^1.11.7",
"jwt-decode": "^3.1.2",
"preact": "^10.6.4",
"prop-types": "^15.8.1",
Expand Down

0 comments on commit 577aeed

Please sign in to comment.