Skip to content

Instantly share code, notes, and snippets.

@mahfelwp
Created January 24, 2020 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahfelwp/365adbc034dbbdf66c8dfc0b81f60b1a to your computer and use it in GitHub Desktop.
Save mahfelwp/365adbc034dbbdf66c8dfc0b81f60b1a to your computer and use it in GitHub Desktop.
Convert activity product date to shamsi(jalali) - youzer plugin
<?php
function convert_activity_product_date_to_shamsi($args , $product){
if( ! function_exists('parsidate') || get_locale() != 'fa_IR' ) {
return false;
}
$args['date'] = parsidate("Y-m-d", $product->get_date_created()->format( 'F j, Y' ), "per");
return $args;
}
add_filter( 'yz_wc_activity_product_args' , 'convert_activity_product_date_to_shamsi', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment