Skip to content

Commit

Permalink
Updates to sanity plugin datetime (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
SG60 authored Jun 27, 2024
2 parents 538dea2 + 484b46a commit 3f44576
Show file tree
Hide file tree
Showing 4 changed files with 8,764 additions and 7,919 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-impalas-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@samgreening/sanity-plugin-datetime': major
---

Updates to work with newer Sanity Studio
26 changes: 9 additions & 17 deletions packages/sanity-plugin-datetime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,26 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@adobe/react-spectrum": "^3.35.1",
"@internationalized/date": "^3.5.4",
"@sanity/icons": "^2.11.8",
"@sanity/ui": "^2.5.0",
"react-aria-components": "^1.2.1",
"sanity": "^3.48.1",
"styled-components": "^6.1.11"
},
"devDependencies": {
"@adobe/react-spectrum": "3.35.1",
"@internationalized/date": "3.5.4",
"@sanity/icons": "2.3.1",
"@sanity/ui": "1.9.3",
"@types/react": "18.2.78",
"@types/styled-components": "5.1.34",
"@typescript-eslint/eslint-plugin": "5.59.6",
"@typescript-eslint/parser": "5.59.6",
"react": "18.2.0",
"react-aria-components": "1.1.1",
"react-dom": "18.2.0",
"react-is": "18.2.0",
"react-stately": "3.23.0",
"sanity": "3.9.1",
"styled-components": "5.3.11",
"typescript": "5.5.2"
},
"peerDependencies": {
"@adobe/react-spectrum": "^3",
"@internationalized/date": "^3",
"@sanity/icons": "^2.3.1",
"@sanity/ui": "^1",
"react": "^18",
"react-aria-components": "1.1.1",
"react-stately": "^3.23.0",
"sanity": "^3",
"styled-components": "^5",
"typescript": "^5"
}
}
4 changes: 2 additions & 2 deletions packages/sanity-plugin-datetime/src/localDateTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function createLocalDatetimeObject(datetime: ZonedDateTime) {
};
}

function LocalDateInputComponent({ value, ...props }: ObjectInputProps<Fields>) {
const LocalDateInputComponent: React.ComponentType<ObjectInputProps> = ({ value, ...props }) => {
// @ts-expect-error
const timezonesList = Intl.supportedValuesOf('timeZone') as string[];

Expand Down Expand Up @@ -118,7 +118,7 @@ function LocalDateInputComponent({ value, ...props }: ObjectInputProps<Fields>)
</Stack>
</ThemeProvider>
);
}
};

const CustomDiffComponent: DiffComponent<ObjectDiff<Fields>> = ({ diff, schemaType }) => {
return (
Expand Down
Loading

0 comments on commit 3f44576

Please sign in to comment.