Skip to content

Commit

Permalink
feat: short form of days added. (#1989)
Browse files Browse the repository at this point in the history
  • Loading branch information
aihimel authored Nov 21, 2023
1 parent bf3e013 commit b04023c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2996,11 +2996,13 @@ function dokan_get_jed_locale_data( $domain, $language_dir = null ) {
*
* @since 2.8.2
*
* @param string|null days
* @param string|null $days
* @maram string/null $form
*
* @return string|array
*/
function dokan_get_translated_days( $day = '' ) {
function dokan_get_translated_days( $day = '', $form = 'long' ) {

$all_days = [
'sunday' => __( 'Sunday', 'dokan-lite' ),
'monday' => __( 'Monday', 'dokan-lite' ),
Expand All @@ -3011,6 +3013,18 @@ function dokan_get_translated_days( $day = '' ) {
'saturday' => __( 'Saturday', 'dokan-lite' ),
];

if ( 'short' === $form ) {
$all_days = [
'sunday' => __( 'Sun', 'dokan-lite' ),
'monday' => __( 'Mon', 'dokan-lite' ),
'tuesday' => __( 'Tue', 'dokan-lite' ),
'wednesday' => __( 'Wed', 'dokan-lite' ),
'thursday' => __( 'Thu', 'dokan-lite' ),
'friday' => __( 'Fri', 'dokan-lite' ),
'saturday' => __( 'Sat', 'dokan-lite' ),
];
}

$week_starts_on = get_option( 'start_of_week', 0 );
$day_keys = array_keys( $all_days );

Expand Down

0 comments on commit b04023c

Please sign in to comment.