Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace method date_i18n by wp_date #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions classes/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ public static function format_date( string $date, string $from_format, string $t
return '';
}

return self::datetime_i18n( $to_format, $date );
return self::wp_date( $to_format, $date );
}

/**
* Format on i18n
* Format on wp_date
ecorica marked this conversation as resolved.
Show resolved Hide resolved
*
* @param string $format
* @param \DateTime $date
*
* @return string
*/
public static function datetime_i18n( string $format, \DateTime $date ): string {
return date_i18n( $format, $date->format( 'U' ) );
public static function wp_date( string $format, \DateTime $date ): string {
ecorica marked this conversation as resolved.
Show resolved Hide resolved
return wp_date( $format, $date->format( 'U' ) );
}

}