Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wise-hounds-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tinacms": patch
---

fix: update date-fs and related types
4 changes: 2 additions & 2 deletions packages/tinacms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"cmdk": "catalog:",
"color-string": "catalog:",
"crypto-js": "catalog:",
"date-fns": "2.30.0",
"date-fns": "4.1.0",
"es-toolkit": "^1.42.0",
"final-form": "catalog:",
"final-form-arrays": "catalog:",
Expand All @@ -109,7 +109,7 @@
"prop-types": "catalog:",
"react-colorful": "catalog:",
"react-datetime": "catalog:",
"react-day-picker": "^9.11.1",
"react-day-picker": "^9.13.0",
"react-dropzone": "catalog:",
"react-final-form": "catalog:",
"react-icons": "^5.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Input } from './input';
import { Popover, PopoverContent, PopoverTrigger } from './popover';
import moment from 'moment';
import 'moment-timezone';
import { enUS } from 'date-fns/locale';
import { enUS, Locale } from 'date-fns/locale';
import { ChevronLeft, ChevronRight } from 'lucide-react';
import { Clock } from 'lucide-react';
import * as React from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore importing css is not recognized
import { DateTimePicker } from '../../components/ui/date-time-picker';
import { DayPickerLocale } from 'react-day-picker';

export const DateField = wrapFieldsWithMeta<InputProps, DatetimepickerProps>(
({ input, field: { dateFormat, timeFormat, onChange, ...rest } }) => {
Expand Down Expand Up @@ -43,10 +44,11 @@ export const DateField = wrapFieldsWithMeta<InputProps, DatetimepickerProps>(
return dateFormat;
}, [dateFormat]);

const date = input.value ? new Date(input.value) : input.value;
const date = input.value ? new Date(input.value) : new Date();
return (
<React.Fragment>
<DateTimePicker
{...rest}
ref={inputRef}
granularity={granularity}
onChange={(value) =>
Expand All @@ -56,7 +58,11 @@ export const DateField = wrapFieldsWithMeta<InputProps, DatetimepickerProps>(
hourCycle={12}
dateFormat={getDateFormat()}
value={date}
{...rest}
locale={
rest.locale
? ({ code: rest.locale } as Partial<DayPickerLocale>)
: undefined
}
/>
</React.Fragment>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useCMS } from '@toolkit/react-tinacms';
import formatDistanceToNow from 'date-fns/formatDistanceToNow';
import { Check, LoaderCircle, TriangleAlert } from 'lucide-react';
import React from 'react';
import { version as currentVersion } from '../../../../package.json';
import { LatestVersionResponse } from '../../../internalClient';
import { formatDistanceToNow } from 'date-fns';

export const VersionInfo = () => {
const cms = useCMS();
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

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

Loading