Skip to content

Commit

Permalink
Merge pull request #139 from sinasaeedi/acfDatePickerFix
Browse files Browse the repository at this point in the history
Jalali datepicker fix for ACF

Thank you @sinasaeedi
  • Loading branch information
man4toman authored Sep 9, 2022
2 parents 9aa7472 + 21b48d9 commit e8f4da8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/plugins/acf-fields/class-wpp-acf-datepicker-v5.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function input_admin_enqueue_scripts() {
* @since 4.0.0
*/
function load_value( $value, $post_id, $field ) {
if ( ! wpp_is_active( 'acf_persian_date' ) && ! is_null( $value ) ) {
if ( ! wpp_is_active( 'acf_persian_date' ) && ! empty( $value ) ) {
$value = parsidate( 'Y-m-d', $value, 'en' );
}

Expand All @@ -111,7 +111,7 @@ function load_value( $value, $post_id, $field ) {
* @since 4.0.0
*/
function update_value( $value, $post_id, $field ) {
if ( ! wpp_is_active( 'acf_persian_date' ) ) {
if ( ! wpp_is_active( 'acf_persian_date' ) && ! empty( $value ) ) {
$value = gregdate( 'Y-m-d', $value );
}

Expand Down

0 comments on commit e8f4da8

Please sign in to comment.