Skip to content

Commit

Permalink
Re-organise date-time dir to have component subdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed May 25, 2022
1 parent 6f4bdca commit 515b283
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import { __, _x } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import Button from '../button';
import { default as DatePicker } from './date';
import { default as TimePicker } from './time';
import type { DateTimePickerProps } from './types';
import Button from '../../button';
import { default as DatePicker } from '../date';
import { default as TimePicker } from '../time';
import type { DateTimePickerProps } from '../types';

export { DatePicker, TimePicker };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { isRTL, _n, sprintf } from '@wordpress/i18n';
* Internal dependencies
*/
import { getMomentDate } from './utils';
import type { DatePickerDayProps, DatePickerProps } from './types';
import type { DatePickerDayProps, DatePickerProps } from '../types';

const TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
const ARIAL_LABEL_TIME_FORMAT = 'dddd, LL';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'react-dates/initialize';
/**
* Internal dependencies
*/
import DatePicker from '../date';
import DatePicker from '..';

describe( 'DatePicker', () => {
it( 'should highlight the current date', () => {
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions packages/components/src/date-time/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Internal dependencies
*/
import { default as DatePicker } from './date';
import { default as TimePicker } from './time';
import { default as DateTimePicker } from './date-time';

export { DatePicker, TimePicker };
export default DateTimePicker;
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import Button from '../button';
import ButtonGroup from '../button-group';
import Button from '../../button';
import ButtonGroup from '../../button-group';
import TimeZone from './timezone';
import type { WordPressComponentProps } from '../ui/context';
import type { UpdateOnBlurAsIntegerFieldProps, TimePickerProps } from './types';
import type { WordPressComponentProps } from '../../ui/context';
import type {
UpdateOnBlurAsIntegerFieldProps,
TimePickerProps,
} from '../types';

const TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import userEvent from '@testing-library/user-event';
/**
* Internal dependencies
*/
import TimePicker from '../time';
import TimePicker from '..';

describe( 'TimePicker', () => {
it( 'should call onChange with updated date values', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { __experimentalGetSettings as getDateSettings } from '@wordpress/date';
/**
* Internal dependencies
*/
import Tooltip from '../tooltip';
import Tooltip from '../../tooltip';

/**
* Displays timezone information when user timezone is different from site
Expand Down

0 comments on commit 515b283

Please sign in to comment.