Plugin Directory

Changeset 3468626


Ignore:
Timestamp:
02/24/2026 12:26:22 PM (5 weeks ago)
Author:
dramb
Message:

Added ability to render the various views which have dates using the Locale to render them in local style and language.

Location:
blocks-for-churchsuite/trunk
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • blocks-for-churchsuite/trunk/blocks-for-churchsuite.php

    r3414516 r3468626  
    44 * Plugin URI:        https://github.com/AlwynBarry/blocks-for-churchsuite
    55 * Description:       Gutenberg blocks to display Data for Events and SmallGroups from ChurchSuite
    6  * Version:           1.0.1
     6 * Version:           1.0.2
    77 * Requires at least: 6.7
    8  * Requires PHP:      7.4
     8 * Requires PHP:      8.0
    99 * Author:            dramb
    1010 * License:           GPL-2.0-or-later
  • blocks-for-churchsuite/trunk/blocks/build/blocks-manifest.php

    r3388993 r3468626  
    66        'apiVersion' => 3,
    77        'name' => 'b4cs/cs-calendar',
    8         'version' => '0.1.0',
     8        'version' => '1.0.2',
    99        'title' => 'Calendar for ChurchSuite',
    1010        'category' => 'widgets',
     
    7373        'apiVersion' => 3,
    7474        'name' => 'b4cs/cs-event-cards',
    75         'version' => '0.1.0',
     75        'version' => '1.0.2',
    7676        'title' => 'Event Cards for ChurchSuite',
    7777        'category' => 'widgets',
     
    164164        'apiVersion' => 3,
    165165        'name' => 'b4cs/cs-event-list',
    166         'version' => '0.1.0',
     166        'version' => '1.0.2',
    167167        'title' => 'Event List for ChurchSuite',
    168168        'category' => 'widgets',
     
    255255        'apiVersion' => 3,
    256256        'name' => 'b4cs/cs-smallgroups',
    257         'version' => '0.1.0',
     257        'version' => '1.0.2',
    258258        'title' => 'Small Groups for ChurchSuite',
    259259        'category' => 'widgets',
  • blocks-for-churchsuite/trunk/blocks/build/cs-calendar/block.json

    r3414516 r3468626  
    33  "apiVersion": 3,
    44  "name": "b4cs/cs-calendar",
    5   "version": "1.0.1",
     5  "version": "1.0.2",
    66  "title": "Calendar for ChurchSuite",
    77  "category": "widgets",
  • blocks-for-churchsuite/trunk/blocks/build/cs-event-cards/block.json

    r3414516 r3468626  
    33  "apiVersion": 3,
    44  "name": "b4cs/cs-event-cards",
    5   "version": "1.0.1",
     5  "version": "1.0.2",
    66  "title": "Event Cards for ChurchSuite",
    77  "category": "widgets",
  • blocks-for-churchsuite/trunk/blocks/build/cs-event-list/block.json

    r3414516 r3468626  
    33  "apiVersion": 3,
    44  "name": "b4cs/cs-event-list",
    5   "version": "1.0.1",
     5  "version": "1.0.2",
    66  "title": "Event List for ChurchSuite",
    77  "category": "widgets",
  • blocks-for-churchsuite/trunk/blocks/build/cs-smallgroups/block.json

    r3414516 r3468626  
    33  "apiVersion": 3,
    44  "name": "b4cs/cs-smallgroups",
    5   "version": "1.0.1",
     5  "version": "1.0.2",
    66  "title": "Small Groups for ChurchSuite",
    77  "category": "widgets",
  • blocks-for-churchsuite/trunk/blocks/build/inc/class-cs-calendar-renderer.php

    r3388993 r3468626  
    5151     * Constant values created to prevent unnecessary re-creation of values used in expressions
    5252     */
     53    protected \IntlDateFormatter $shortDayFormat;
     54    protected \IntlDateFormatter $shortMonthFormat;
     55    protected \IntlDateFormatter $longMonthFormat;
    5356    protected readonly \DateInterval $one_day;
    5457    protected readonly \DateInterval $one_week;
    5558    protected readonly \DateInterval $one_month;
    5659    protected readonly string $page_url;
    57    
    5860    protected \DateTime $today;
    5961    protected \DateTime $requested_date;
     
    7476     */
    7577    public function __construct( $atts ) {
    76         // Set the values always required by this shortcode
    77         $this->page_url = get_permalink();
     78        // Set the date formatters used to remove repeated instance creation
     79        // TEST: \Locale::setDefault('de-DE');
     80        $this->shortDayFormat = datefmt_create(
     81            \Locale::getDefault(),
     82            \IntlDateFormatter::FULL,
     83            \IntlDateFormatter::NONE,
     84            null,
     85            \IntlDateFormatter::GREGORIAN,
     86            'EEE'
     87        );
     88        $this->shortMonthFormat = datefmt_create(
     89            \Locale::getDefault(),
     90            \IntlDateFormatter::FULL,
     91            \IntlDateFormatter::NONE,
     92            null,
     93            \IntlDateFormatter::GREGORIAN,
     94            'MMM'
     95        );
     96        $this->longMonthFormat = datefmt_create(
     97            \Locale::getDefault(),
     98            \IntlDateFormatter::FULL,
     99            \IntlDateFormatter::NONE,
     100            null,
     101            \IntlDateFormatter::GREGORIAN,
     102            'MMMM'
     103        );
     104
     105        // Set the date constants used to remove repeated instance creation
    78106        $this->one_day = \DateInterval::createFromDateString( '1 day' );
    79107        $this->one_week = \DateInterval::createFromDateString( '1 week' );
    80108        $this->one_month = \DateInterval::createFromDateString( '1 month' );
     109
     110        // Set the values always required by this shortcode
     111        $this->page_url = get_permalink();
    81112        $this->today = new \DateTime();
    82113        $this->today->setTime( 0, 0 );
     
    227258            . '    <div class="b4cs-calendar-month-header">' . "\n"
    228259            . '      <div class="b4cs-calendar-month-title">' . "\n"
    229             . '        ' .  $date->format( 'F' ) . ' ' .  $date->format( 'Y' ) . "\n"
     260            . '        ' . datefmt_format($this->longMonthFormat, $date) .  ' ' . $date->format( 'Y' ) . "\n"   /* . '        ' .  $date->format( 'F' ) . ' ' .  $date->format( 'Y' ) . "\n" */
    230261            . '      </div>' . "\n"
    231262            . '      <div class="b4cs-calendar-month-nav">' . "\n"
     
    248279        $period = new \DatePeriod( $sunday_date, $this->one_day, $saturday_date );
    249280        foreach ( $period as $day ) {
    250             $output .= '        <div class="b4cs-calendar-day-name-cell">' . $day->format( 'D' ) . '</div>' . "\n";
     281            /* $output .= '        <div class="b4cs-calendar-day-name-cell">' . $day->format( 'D' ) . '</div>' . "\n"; */
     282            $output .= '        <div class="b4cs-calendar-day-name-cell">' . datefmt_format($this->shortDayFormat, $day) . '</div>' . "\n";
    251283        }
    252284
     
    290322        $output .= '      <span class="b4cs-day">' . $date->format( 'D' ) . '</span>' . "\n";
    291323        $output .= '      <span class="b4cs-date-number">' . $day . '</span>' . "\n";
    292         $output .= '      <span class="b4cs-month">' . $date->format( 'F' ) . '</span>' . "\n";
     324        $output .= '      <span class="b4cs-month">' . datefmt_format($this->shortMonthFormat, $date) . '</span>' . "\n";   
     325        /* $output .= '      <span class="b4cs-month">' . $date->format( 'F' ) . '</span>' . "\n"; */
    293326        $output .= '      <span class="b4cs-year">' . $date->format( 'Y' ) . '</span>' . "\n";
    294327        $output .= '    </div>';
  • blocks-for-churchsuite/trunk/blocks/build/inc/class-cs-compact-event-view.php

    r3388993 r3468626  
    3232
    3333    /*
     34     * Constant values created to prevent unnecessary re-creation of values used in expressions
     35     */
     36    protected \IntlDateFormatter $timeFormat;
     37
     38    /*
    3439     * The event to be displayed, set via the constructor
    3540     * @since 1.0.0
     
    5156        parent::__construct( $cs );
    5257        $this->cs_event = $cs_event;
     58        $this->set_date_formatters();
     59    }
     60
     61    /*
     62     * Set the 'constant' values used to remove repeated instance creation of the required date formatters.
     63     */
     64    private function set_date_formatters() {
     65        // Set the date formatters used to remove repeated instance creation
     66        $this->timeFormat = datefmt_create(
     67            \Locale::getDefault(),
     68            \IntlDateFormatter::NONE,
     69            \IntlDateFormatter::SHORT,
     70            null,
     71            \IntlDateFormatter::GREGORIAN
     72        );
    5373    }
    5474
     
    6888        // Display the event time and the end time if provided
    6989        if ( $this->cs_event->is_start_date() ) {
    70             $output .= '    <div class="b4cs-time"><span class="b4cs-start-time">' . date_format( $this->cs_event->get_start_date(), 'g:ia' ) . '</span>';
    71             $output .= ( $this->cs_event->is_end_date() ) ? '-' . '<span class="b4cs-end-time">' . date_format( $this->cs_event->get_end_date(), 'g:ia' ) . '</span>' : '';
     90            $output .= '    <div class="b4cs-time"><span class="b4cs-start-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_start_date() ) . '</span>';
     91            $output .= ( $this->cs_event->is_end_date() ) ? '-' . '<span class="b4cs-end-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_end_date() ) . '</span>' : '';
    7292            $output .= '</div>' . "\n";
    7393        }
  • blocks-for-churchsuite/trunk/blocks/build/inc/class-cs-event-card-view.php

    r3388993 r3468626  
    3232
    3333    /*
     34     * Constant values created to prevent unnecessary re-creation of values used in expressions
     35     */
     36    protected \IntlDateFormatter $monthAndDateFormat;
     37    protected \IntlDateFormatter $timeFormat;
     38
     39    /*
    3440     * The event to be displayed, set via the constructor
    3541     * @since 1.0.0
     
    5157        parent::__construct( $cs );
    5258        $this->cs_event = $cs_event;
     59        // Set the constant values for the date formatters needed
     60        $this->set_date_formatters();
     61    }
     62
     63    /*
     64     * Set the 'constant' values used to remove repeated instance creation of the required date formatters.
     65     */
     66    private function set_date_formatters() {
     67        // Set the date formatters used to remove repeated instance creation
     68        // TEST: \Locale::setDefault('de-DE');
     69        $this->monthAndDateFormat = datefmt_create(
     70            \Locale::getDefault(),
     71            \IntlDateFormatter::MEDIUM,
     72            \IntlDateFormatter::NONE,
     73            null,
     74            \IntlDateFormatter::GREGORIAN
     75        );
     76        $this->timeFormat = datefmt_create(
     77            \Locale::getDefault(),
     78            \IntlDateFormatter::NONE,
     79            \IntlDateFormatter::SHORT,
     80            null,
     81            \IntlDateFormatter::GREGORIAN
     82        );
    5383    }
    5484
     
    6191     */
    6292    public function display() : string {
     93       
    6394        // Display the card, and include the event unique ID
    6495        $output = '<div '
     
    82113        // Display the start and end times where they are provided
    83114        if ( $this->cs_event->is_start_date() ) {
    84             $output .= '    <div class="b4cs-date"><span class="b4cs-date-gliph">' . date_format( $this->cs_event->get_start_date(),'M jS, Y' ) . '</span></div>' . "\n";
     115            $output .= '    <div class="b4cs-date"><span class="b4cs-date-gliph">' . datefmt_format( $this->monthAndDateFormat, $this->cs_event->get_start_date() ) . '</span></div>' . "\n";
    85116            $output .= '    <div class="b4cs-time">';
    86             $output .= '        <span class="b4cs-time-gliph b4cs-start-time">' . date_format( $this->cs_event->get_start_date(), 'g:ia' ) . '</span>';
    87             $output .= ( $this->cs_event->is_end_date() ) ? ' - <span class="b4cs-end-time">' . date_format( $this->cs_event->get_end_date(), 'g:ia' ) . '</span>' . "\n" : "\n";
     117            $output .= '        <span class="b4cs-time-gliph b4cs-start-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_start_date() ) . '</span>';
     118            $output .= ( $this->cs_event->is_end_date() ) ? ' - <span class="b4cs-end-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_end_date() ) . '</span>' . "\n" : "\n";
    88119            $output .= '    </div>' . "\n";
    89120        }
  • blocks-for-churchsuite/trunk/blocks/build/inc/class-cs-event-list-renderer.php

    r3388993 r3468626  
    8282    protected function display_event_date( \DateTime $event_date ) : string {
    8383        $result = '<div class="b4cs-date">';
    84         $result .= '<span class="b4cs-day">' . $event_date->format( 'D' ) . '</span>';
    85         $result .= '<span class="b4cs-date-number">' . $event_date->format( 'd' ) . '</span>';
    86         $result .= '<span class="b4cs-month">' . $event_date->format( 'M' ) . '</span>';
    87         $result .= '<span class="b4cs-year">' . $event_date->format( 'Y' ) . '</span>';
     84        $result .= '<span class="b4cs-day">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'EE' ), $event_date ) . '</span>';
     85        $result .= '<span class="b4cs-date-number">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'dd' ), $event_date ) . '</span>';
     86        $result .= '<span class="b4cs-month">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'MMM' ), $event_date ) . '</span>';
     87        $result .= '<span class="b4cs-year">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'yyyy' ), $event_date ) . '</span>';
    8888        $result .= '</div>';
    8989        return $result;
  • blocks-for-churchsuite/trunk/blocks/build/inc/class-cs-group.php

    r3388993 r3468626  
    146146     */
    147147    protected function fetch_time_of_meeting( \stdclass $group_obj ) : string {
     148        // TEST: \Locale::setDefault('de-DE');
     149        $timeFormat = datefmt_create(
     150            \Locale::getDefault(),
     151            \IntlDateFormatter::NONE,
     152            \IntlDateFormatter::SHORT,
     153            null,
     154            \IntlDateFormatter::GREGORIAN
     155        );
    148156        return ( isset( $group_obj->time ) && ( $group_obj->time !== '' ) )
    149             ? date_format( date_create( $group_obj->time ), 'g:ia' )
     157            ? datefmt_format( $timeFormat, date_create( $group_obj->time ) )
    150158            : '' ;
    151159    }
  • blocks-for-churchsuite/trunk/blocks/src/cs-calendar/block.json

    r3414516 r3468626  
    33    "apiVersion": 3,
    44    "name": "b4cs/cs-calendar",
    5     "version": "1.0.1",
     5    "version": "1.0.2",
    66    "title": "Calendar for ChurchSuite",
    77    "category": "widgets",
  • blocks-for-churchsuite/trunk/blocks/src/cs-event-cards/block.json

    r3414516 r3468626  
    33    "apiVersion": 3,
    44    "name": "b4cs/cs-event-cards",
    5     "version": "1.0.1",
     5    "version": "1.0.2",
    66    "title": "Event Cards for ChurchSuite",
    77    "category": "widgets",
  • blocks-for-churchsuite/trunk/blocks/src/cs-event-list/block.json

    r3414516 r3468626  
    33    "apiVersion": 3,
    44    "name": "b4cs/cs-event-list",
    5     "version": "1.0.1",
     5    "version": "1.0.2",
    66    "title": "Event List for ChurchSuite",
    77    "category": "widgets",
  • blocks-for-churchsuite/trunk/blocks/src/cs-smallgroups/block.json

    r3414516 r3468626  
    33    "apiVersion": 3,
    44    "name": "b4cs/cs-smallgroups",
    5     "version": "1.0.1",
     5    "version": "1.0.2",
    66    "title": "Small Groups for ChurchSuite",
    77    "category": "widgets",
  • blocks-for-churchsuite/trunk/blocks/src/inc/class-cs-calendar-renderer.php

    r3388993 r3468626  
    5151     * Constant values created to prevent unnecessary re-creation of values used in expressions
    5252     */
     53    protected \IntlDateFormatter $shortDayFormat;
     54    protected \IntlDateFormatter $shortMonthFormat;
     55    protected \IntlDateFormatter $longMonthFormat;
    5356    protected readonly \DateInterval $one_day;
    5457    protected readonly \DateInterval $one_week;
    5558    protected readonly \DateInterval $one_month;
    5659    protected readonly string $page_url;
    57    
    5860    protected \DateTime $today;
    5961    protected \DateTime $requested_date;
     
    7476     */
    7577    public function __construct( $atts ) {
    76         // Set the values always required by this shortcode
    77         $this->page_url = get_permalink();
     78        // Set the date formatters used to remove repeated instance creation
     79        // TEST: \Locale::setDefault('de-DE');
     80        $this->shortDayFormat = datefmt_create(
     81            \Locale::getDefault(),
     82            \IntlDateFormatter::FULL,
     83            \IntlDateFormatter::NONE,
     84            null,
     85            \IntlDateFormatter::GREGORIAN,
     86            'EEE'
     87        );
     88        $this->shortMonthFormat = datefmt_create(
     89            \Locale::getDefault(),
     90            \IntlDateFormatter::FULL,
     91            \IntlDateFormatter::NONE,
     92            null,
     93            \IntlDateFormatter::GREGORIAN,
     94            'MMM'
     95        );
     96        $this->longMonthFormat = datefmt_create(
     97            \Locale::getDefault(),
     98            \IntlDateFormatter::FULL,
     99            \IntlDateFormatter::NONE,
     100            null,
     101            \IntlDateFormatter::GREGORIAN,
     102            'MMMM'
     103        );
     104
     105        // Set the date constants used to remove repeated instance creation
    78106        $this->one_day = \DateInterval::createFromDateString( '1 day' );
    79107        $this->one_week = \DateInterval::createFromDateString( '1 week' );
    80108        $this->one_month = \DateInterval::createFromDateString( '1 month' );
     109
     110        // Set the values always required by this shortcode
     111        $this->page_url = get_permalink();
    81112        $this->today = new \DateTime();
    82113        $this->today->setTime( 0, 0 );
     
    227258            . '    <div class="b4cs-calendar-month-header">' . "\n"
    228259            . '      <div class="b4cs-calendar-month-title">' . "\n"
    229             . '        ' .  $date->format( 'F' ) . ' ' .  $date->format( 'Y' ) . "\n"
     260            . '        ' . datefmt_format($this->longMonthFormat, $date) .  ' ' . $date->format( 'Y' ) . "\n"   /* . '        ' .  $date->format( 'F' ) . ' ' .  $date->format( 'Y' ) . "\n" */
    230261            . '      </div>' . "\n"
    231262            . '      <div class="b4cs-calendar-month-nav">' . "\n"
     
    248279        $period = new \DatePeriod( $sunday_date, $this->one_day, $saturday_date );
    249280        foreach ( $period as $day ) {
    250             $output .= '        <div class="b4cs-calendar-day-name-cell">' . $day->format( 'D' ) . '</div>' . "\n";
     281            /* $output .= '        <div class="b4cs-calendar-day-name-cell">' . $day->format( 'D' ) . '</div>' . "\n"; */
     282            $output .= '        <div class="b4cs-calendar-day-name-cell">' . datefmt_format($this->shortDayFormat, $day) . '</div>' . "\n";
    251283        }
    252284
     
    290322        $output .= '      <span class="b4cs-day">' . $date->format( 'D' ) . '</span>' . "\n";
    291323        $output .= '      <span class="b4cs-date-number">' . $day . '</span>' . "\n";
    292         $output .= '      <span class="b4cs-month">' . $date->format( 'F' ) . '</span>' . "\n";
     324        $output .= '      <span class="b4cs-month">' . datefmt_format($this->shortMonthFormat, $date) . '</span>' . "\n";   
     325        /* $output .= '      <span class="b4cs-month">' . $date->format( 'F' ) . '</span>' . "\n"; */
    293326        $output .= '      <span class="b4cs-year">' . $date->format( 'Y' ) . '</span>' . "\n";
    294327        $output .= '    </div>';
  • blocks-for-churchsuite/trunk/blocks/src/inc/class-cs-compact-event-view.php

    r3388993 r3468626  
    3232
    3333    /*
     34     * Constant values created to prevent unnecessary re-creation of values used in expressions
     35     */
     36    protected \IntlDateFormatter $timeFormat;
     37
     38    /*
    3439     * The event to be displayed, set via the constructor
    3540     * @since 1.0.0
     
    5156        parent::__construct( $cs );
    5257        $this->cs_event = $cs_event;
     58        $this->set_date_formatters();
     59    }
     60
     61    /*
     62     * Set the 'constant' values used to remove repeated instance creation of the required date formatters.
     63     */
     64    private function set_date_formatters() {
     65        // Set the date formatters used to remove repeated instance creation
     66        $this->timeFormat = datefmt_create(
     67            \Locale::getDefault(),
     68            \IntlDateFormatter::NONE,
     69            \IntlDateFormatter::SHORT,
     70            null,
     71            \IntlDateFormatter::GREGORIAN
     72        );
    5373    }
    5474
     
    6888        // Display the event time and the end time if provided
    6989        if ( $this->cs_event->is_start_date() ) {
    70             $output .= '    <div class="b4cs-time"><span class="b4cs-start-time">' . date_format( $this->cs_event->get_start_date(), 'g:ia' ) . '</span>';
    71             $output .= ( $this->cs_event->is_end_date() ) ? '-' . '<span class="b4cs-end-time">' . date_format( $this->cs_event->get_end_date(), 'g:ia' ) . '</span>' : '';
     90            $output .= '    <div class="b4cs-time"><span class="b4cs-start-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_start_date() ) . '</span>';
     91            $output .= ( $this->cs_event->is_end_date() ) ? '-' . '<span class="b4cs-end-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_end_date() ) . '</span>' : '';
    7292            $output .= '</div>' . "\n";
    7393        }
  • blocks-for-churchsuite/trunk/blocks/src/inc/class-cs-event-card-view.php

    r3388993 r3468626  
    3232
    3333    /*
     34     * Constant values created to prevent unnecessary re-creation of values used in expressions
     35     */
     36    protected \IntlDateFormatter $monthAndDateFormat;
     37    protected \IntlDateFormatter $timeFormat;
     38
     39    /*
    3440     * The event to be displayed, set via the constructor
    3541     * @since 1.0.0
     
    5157        parent::__construct( $cs );
    5258        $this->cs_event = $cs_event;
     59        // Set the constant values for the date formatters needed
     60        $this->set_date_formatters();
     61    }
     62
     63    /*
     64     * Set the 'constant' values used to remove repeated instance creation of the required date formatters.
     65     */
     66    private function set_date_formatters() {
     67        // Set the date formatters used to remove repeated instance creation
     68        // TEST: \Locale::setDefault('de-DE');
     69        $this->monthAndDateFormat = datefmt_create(
     70            \Locale::getDefault(),
     71            \IntlDateFormatter::MEDIUM,
     72            \IntlDateFormatter::NONE,
     73            null,
     74            \IntlDateFormatter::GREGORIAN
     75        );
     76        $this->timeFormat = datefmt_create(
     77            \Locale::getDefault(),
     78            \IntlDateFormatter::NONE,
     79            \IntlDateFormatter::SHORT,
     80            null,
     81            \IntlDateFormatter::GREGORIAN
     82        );
    5383    }
    5484
     
    6191     */
    6292    public function display() : string {
     93       
    6394        // Display the card, and include the event unique ID
    6495        $output = '<div '
     
    82113        // Display the start and end times where they are provided
    83114        if ( $this->cs_event->is_start_date() ) {
    84             $output .= '    <div class="b4cs-date"><span class="b4cs-date-gliph">' . date_format( $this->cs_event->get_start_date(),'M jS, Y' ) . '</span></div>' . "\n";
     115            $output .= '    <div class="b4cs-date"><span class="b4cs-date-gliph">' . datefmt_format( $this->monthAndDateFormat, $this->cs_event->get_start_date() ) . '</span></div>' . "\n";
    85116            $output .= '    <div class="b4cs-time">';
    86             $output .= '        <span class="b4cs-time-gliph b4cs-start-time">' . date_format( $this->cs_event->get_start_date(), 'g:ia' ) . '</span>';
    87             $output .= ( $this->cs_event->is_end_date() ) ? ' - <span class="b4cs-end-time">' . date_format( $this->cs_event->get_end_date(), 'g:ia' ) . '</span>' . "\n" : "\n";
     117            $output .= '        <span class="b4cs-time-gliph b4cs-start-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_start_date() ) . '</span>';
     118            $output .= ( $this->cs_event->is_end_date() ) ? ' - <span class="b4cs-end-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_end_date() ) . '</span>' . "\n" : "\n";
    88119            $output .= '    </div>' . "\n";
    89120        }
  • blocks-for-churchsuite/trunk/blocks/src/inc/class-cs-event-list-renderer.php

    r3388993 r3468626  
    8282    protected function display_event_date( \DateTime $event_date ) : string {
    8383        $result = '<div class="b4cs-date">';
    84         $result .= '<span class="b4cs-day">' . $event_date->format( 'D' ) . '</span>';
    85         $result .= '<span class="b4cs-date-number">' . $event_date->format( 'd' ) . '</span>';
    86         $result .= '<span class="b4cs-month">' . $event_date->format( 'M' ) . '</span>';
    87         $result .= '<span class="b4cs-year">' . $event_date->format( 'Y' ) . '</span>';
     84        $result .= '<span class="b4cs-day">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'EE' ), $event_date ) . '</span>';
     85        $result .= '<span class="b4cs-date-number">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'dd' ), $event_date ) . '</span>';
     86        $result .= '<span class="b4cs-month">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'MMM' ), $event_date ) . '</span>';
     87        $result .= '<span class="b4cs-year">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'yyyy' ), $event_date ) . '</span>';
    8888        $result .= '</div>';
    8989        return $result;
  • blocks-for-churchsuite/trunk/blocks/src/inc/class-cs-group.php

    r3388993 r3468626  
    146146     */
    147147    protected function fetch_time_of_meeting( \stdclass $group_obj ) : string {
     148        // TEST: \Locale::setDefault('de-DE');
     149        $timeFormat = datefmt_create(
     150            \Locale::getDefault(),
     151            \IntlDateFormatter::NONE,
     152            \IntlDateFormatter::SHORT,
     153            null,
     154            \IntlDateFormatter::GREGORIAN
     155        );
    148156        return ( isset( $group_obj->time ) && ( $group_obj->time !== '' ) )
    149             ? date_format( date_create( $group_obj->time ), 'g:ia' )
     157            ? datefmt_format( $timeFormat, date_create( $group_obj->time ) )
    150158            : '' ;
    151159    }
  • blocks-for-churchsuite/trunk/readme.txt

    r3414516 r3468626  
    33* Tags: Events, Groups, ChurchSuite, Blocks
    44* Requires at least: 6.7
    5 * Tested up to: 6.9
    6 * Stable tag: 1.0.1
     5* Tested up to: 6.9.1
     6* Stable tag: 1.0.2
    77* License: GPLv2 or later
    88
     
    264264== Changelog ==
    265265
     266
     267= 1.0.2 =
     268
     269**2026-02-23**
     270* Added ability to render the various views which have dates using the Locale
     271  to render them in local style and language.
     272* Version bump to 1.0.2
     273
    266274= 1.0.1 =
     275
    267276**2025-12-08**
    268277* Bump for Wordpress 6.9.  Updated 'Tested up to:' in readme.txt, and to
Note: See TracChangeset for help on using the changeset viewer.