Let the @wordpress/date module handle it.
This commit is contained in:
Jeff Stieler 2019-12-05 17:38:07 -05:00 committed by Paul Sealock
parent 0c5c0f1571
commit 6a8124ffd0
3 changed files with 0 additions and 22 deletions

View File

@ -32,15 +32,10 @@ import {
weekTicksThreshold,
defaultTableDateFormat,
getDateFormatsForInterval,
loadLocaleData,
dateValidationMessages,
validateDateInputForRange,
} from '@woocommerce/date';
// Load the store's locale.
const localeSettings = getSetting( 'locale' );
loadLocaleData( localeSettings );
// Compose methods with store settings.
const {
woocommerce_default_date_range: defaultDateRange = 'period=month&compare=previous_year',
@ -69,7 +64,6 @@ export {
weekTicksThreshold,
defaultTableDateFormat,
getDateFormatsForInterval,
loadLocaleData,
dateValidationMessages,
validateDateInputForRange,
};

View File

@ -7,7 +7,6 @@ import {
getDateParamsFromQuery,
getCurrentDates,
isoDateFormat,
loadLocaleData,
} from '@woocommerce/date';
/**
@ -17,13 +16,6 @@ import { partialRight } from 'lodash';
const query = {};
// Fetch locale from store settings and load for date functions.
const localeSettings = {
userLocale: 'fr_FR',
weekdaysShort: [ 'dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam' ],
};
loadLocaleData( localeSettings );
const defaultDateRange = 'period=month&compare=previous_year';
const storeGetDateParamsFromQuery = partialRight( getDateParamsFromQuery, defaultDateRange );
const storeGetCurrentDates = partialRight( getCurrentDates, defaultDateRange );

View File

@ -13,7 +13,6 @@ import {
getDateParamsFromQuery,
getCurrentDates,
isoDateFormat,
loadLocaleData,
} from '@woocommerce/date';
/**
@ -31,13 +30,6 @@ const ORDER_STATUSES = {
refunded: 'Refunded',
};
// Fetch locale from store settings and load for date functions.
const localeSettings = {
userLocale: 'fr_FR',
weekdaysShort: [ 'dim', 'lun', 'mar', 'mer', 'jeu', 'ven', 'sam' ],
};
loadLocaleData( localeSettings );
// Fetch store default date range and compose with date utility functions.
const defaultDateRange = 'period=month&compare=previous_year';
const storeGetDateParamsFromQuery = partialRight( getDateParamsFromQuery, defaultDateRange );