Remove unnecessary locale update call. (https://github.com/woocommerce/woocommerce-admin/pull/3362)
Let the @wordpress/date module handle it.
This commit is contained in:
parent
0c5c0f1571
commit
6a8124ffd0
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue