Plugin Directory

Changeset 3481344


Ignore:
Timestamp:
03/12/2026 04:45:36 PM (2 weeks ago)
Author:
d_alinus2004
Message:

date format uses WordPress setting instead of hardcoded Romanian

File:
1 edited

Legend:

Unmodified
Added
Removed
  • flash-sale-scheduler-for-woocommerce/trunk/includes/class-frontend-display.php

    r3476299 r3481344  
    384384
    385385    private function format_date_ro($date) {
    386         $months = [
    387             '01' => 'ianuarie','02' => 'februarie','03' => 'martie','04' => 'aprilie',
    388             '05' => 'mai','06' => 'iunie','07' => 'iulie','08' => 'august',
    389             '09' => 'septembrie','10' => 'octombrie','11' => 'noiembrie','12' => 'decembrie',
    390         ];
    391 
    392386        if (!is_string($date) || trim($date) === '') return '';
    393 
    394         $parts = explode('-', $date);
    395         if (count($parts) !== 3) return $date;
    396 
    397         return intval($parts[2]) . ' ' . ($months[$parts[1]] ?? $parts[1]) . ' ' . $parts[0];
     387        $ts = strtotime($date);
     388        if (!$ts) return $date;
     389        return date_i18n(get_option('date_format'), $ts);
    398390    }
    399391
Note: See TracChangeset for help on using the changeset viewer.