chamiewp
Forum Replies Created
-
Forum: Plugins
In reply to: [MANGOPAY for WooCommerce] Issue on datepicker since last updateNote for the dev team, you should rename the $sFormat to $phpFormat or $wpFormat.
$sFormat and $jsFormat are really close, it’s a typo-friendly naming choice ^^
Forum: Plugins
In reply to: [MANGOPAY for WooCommerce] Issue on datepicker since last updateI did find the issue. 😉
in /inc/main.inc.php:L3497
`private function date_format_php_to_js( $sFormat ) {
switch( $sFormat ) {
//Predefined WP date formats
case ‘F j, Y’:
return( ‘MM dd, yy’ );
break;
case ‘F js, Y’:
return( ‘MM dd, yy’ );
break;
case ‘Y/m/d’:
return( ‘yy/mm/dd’ );
break;
case ‘m/d/Y’:
return( ‘mm/dd/yy’ );
break;
case ‘d/m/Y’:
return( ‘dd/mm/yy’ );
break;
default:
$jsFormat = preg_replace( ‘/F/’, ‘MM’, $sFormat );
$jsFormat = preg_replace( ‘/S/’, ”, $sFormat );
$jsFormat = preg_replace( ‘/d/’, ‘dd’, $jsFormat );
$jsFormat = preg_replace( ‘/j/’, ‘dd’, $jsFormat );
$jsFormat = preg_replace( ‘/Y/’, ‘yy’, $jsFormat );
$jsFormat = preg_replace( ‘/m/’, ‘mm’, $jsFormat );
$jsFormat = str_replace(‘ ‘, ‘ ‘,$jsFormat);
return $jsFormat;
}
}`The variable $jsFormat is override by the second preg_replace
Should be :
`private function date_format_php_to_js( $sFormat ) {
switch( $sFormat ) {
//Predefined WP date formats
case ‘F j, Y’:
return( ‘MM dd, yy’ );
break;
case ‘F js, Y’:
return( ‘MM dd, yy’ );
break;
case ‘Y/m/d’:
return( ‘yy/mm/dd’ );
break;
case ‘m/d/Y’:
return( ‘mm/dd/yy’ );
break;
case ‘d/m/Y’:
return( ‘dd/mm/yy’ );
break;
default:
$jsFormat = preg_replace( ‘/F/’, ‘MM’, $sFormat );
$jsFormat = preg_replace( ‘/S/’, ”, $jsFormat );
$jsFormat = preg_replace( ‘/d/’, ‘dd’, $jsFormat );
$jsFormat = preg_replace( ‘/j/’, ‘dd’, $jsFormat );
$jsFormat = preg_replace( ‘/Y/’, ‘yy’, $jsFormat );
$jsFormat = preg_replace( ‘/m/’, ‘mm’, $jsFormat );
$jsFormat = str_replace(‘ ‘, ‘ ‘,$jsFormat);
return $jsFormat;
}
}`Forum: Plugins
In reply to: [MANGOPAY for WooCommerce] Issue on datepicker since last updateCould you reproduce?
Forum: Plugins
In reply to: [MANGOPAY for WooCommerce] Issue on datepicker since last updateYes the one in the WP dashboard (user)