Change experiment name to dynamic

This commit is contained in:
Ilyas Foo 2022-04-26 10:47:01 +08:00
parent 6151f4021c
commit 2398fdf772
1 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import {
} from '@woocommerce/data'; } from '@woocommerce/data';
import { useSelect } from '@wordpress/data'; import { useSelect } from '@wordpress/data';
import { useExperiment } from '@woocommerce/explat'; import { useExperiment } from '@woocommerce/explat';
import moment from 'moment';
/** /**
* Internal dependencies * Internal dependencies
@ -172,8 +173,11 @@ export const PaymentsBannerWrapper = () => {
} }
); );
const momentDate = moment().utc();
const year = momentDate.format( 'YYYY' );
const month = momentDate.format( 'MM' );
const [ isLoadingExperiment, experimentAssignment ] = useExperiment( const [ isLoadingExperiment, experimentAssignment ] = useExperiment(
'woocommerce_payments_settings_banner_2022_04' `woocommerce_payments_settings_banner_${ year }_${ month }`
); );
if ( ! isResolving && ! isLoadingExperiment ) { if ( ! isResolving && ! isLoadingExperiment ) {
if ( if (