2017 © Pedro PelĂĄez
 

library wp-datetime

image

pronamic/wp-datetime

  • Friday, June 29, 2018
  • by remcotolsma
  • Repository
  • 5 Watchers
  • 0 Stars
  • 693 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 98 % Grown

The README.md

WordPress DateTime

WordPress Filters

pronamic_datetime_default_format

function prefix_pronamic_datetime_default_format( $format ) {
    return _x( 'D j M Y \a\t H:i', 'default datetime format', 'pronamic-ideal' );
}

add_filter( 'pronamic_datetime_default_format', 'prefix_pronamic_datetime_default_format' );

Note date_i18n

It is important to note that date_i18n():, (*1)

  1. does not have full feature parity with date(), not all formats are supported (such as shorthands);
  2. does not accept Unix timestamp (despite documented to), the expected value is “WordPress timestamp” (offset by time zone);
  3. has issues with certain timezone settings, such as numerical ones;
  4. does nothing with $gmt argument under normal circumstances;

Any use of this function must be carefully audited for correctness, especially in regards to output of time zones., (*2)

Source: https://developer.wordpress.org/reference/functions/date_i18n/#comment-2403, (*3)

Inspiration

  • https://github.com/woocommerce/woocommerce/blob/3.3.5/includes/class-wc-datetime.php
  • https://github.com/Rarst/wpdatetime

Pronamic - Work with us, (*4)

The Versions