Skip to content

Commit

Permalink
Merge branch 'master' into fix/fus-115-utilise-editor-permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
screamcha authored Nov 29, 2024
2 parents 42927c8 + b533366 commit 13971da
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
6 changes: 6 additions & 0 deletions packages/date/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.7.0](https://github.com/contentful/field-editors/compare/@contentful/[email protected]...@contentful/[email protected]) (2024-11-28)

### Features

- **date:** allow arbitrary date range [ZEND-5700] ([#1806](https://github.com/contentful/field-editors/issues/1806)) ([9bbb2a1](https://github.com/contentful/field-editors/commit/9bbb2a15c398bc6c38a832ea867af031f36ef4b3))

## [1.6.29](https://github.com/contentful/field-editors/compare/@contentful/[email protected]...@contentful/[email protected]) (2024-11-26)

**Note:** Version bump only for package @contentful/field-editor-date
Expand Down
2 changes: 1 addition & 1 deletion packages/date/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/field-editor-date",
"version": "1.6.29",
"version": "1.7.0",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
Expand Down
15 changes: 1 addition & 14 deletions packages/date/src/DatepickerInput.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React, { useMemo } from 'react';
import React from 'react';

import { Datepicker } from '@contentful/f36-components';
import { css } from 'emotion';
// eslint-disable-next-line -- TODO: move to date-fns
import moment from 'moment';

const YEAR_RANGE = 100;

const styles = {
root: css({
maxWidth: '270px',
Expand All @@ -20,15 +18,6 @@ export type DatePickerProps = {
};

export const DatepickerInput = (props: DatePickerProps) => {
const [fromDate, toDate] = useMemo(() => {
const fromDate = new Date();
fromDate.setFullYear(fromDate.getFullYear() - YEAR_RANGE);
const toDate = new Date();
toDate.setFullYear(toDate.getFullYear() + YEAR_RANGE);

return [fromDate, toDate];
}, []);

// The DatepickerInput should be time and timezone agnostic,
// thats why we don't use moment().toDate() to get Date object.
// moment().toDate() takes into account time and timezone and converts it
Expand All @@ -47,8 +36,6 @@ export const DatepickerInput = (props: DatePickerProps) => {
props.onChange(momentDay);
}}
inputProps={{ isDisabled: props.disabled, placeholder: '' }}
fromDate={fromDate}
toDate={toDate}
/>
);
};
4 changes: 4 additions & 0 deletions packages/default-field-editors/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.7.40](https://github.com/contentful/field-editors/compare/@contentful/[email protected]...@contentful/[email protected]) (2024-11-28)

**Note:** Version bump only for package @contentful/default-field-editors

## [1.7.39](https://github.com/contentful/field-editors/compare/@contentful/[email protected]...@contentful/[email protected]) (2024-11-27)

**Note:** Version bump only for package @contentful/default-field-editors
Expand Down
4 changes: 2 additions & 2 deletions packages/default-field-editors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/default-field-editors",
"version": "1.7.39",
"version": "1.7.40",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
Expand Down Expand Up @@ -38,7 +38,7 @@
"@contentful/f36-components": "^4.70.0",
"@contentful/field-editor-boolean": "^1.4.29",
"@contentful/field-editor-checkbox": "^1.4.29",
"@contentful/field-editor-date": "^1.6.29",
"@contentful/field-editor-date": "^1.7.0",
"@contentful/field-editor-dropdown": "^1.5.13",
"@contentful/field-editor-json": "^3.3.34",
"@contentful/field-editor-list": "^1.4.29",
Expand Down

0 comments on commit 13971da

Please sign in to comment.