Skip to content

Commit

Permalink
No longer use files from plugin directory pronamic-ideal/images.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Jun 7, 2024
1 parent a252c7e commit fa893a6
Show file tree
Hide file tree
Showing 660 changed files with 89,703 additions and 45 deletions.
152 changes: 152 additions & 0 deletions packages/pronamic/wp-datetime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# Change Log

All notable changes to this project will be documented in this file.

This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com/).

## [Unreleased][unreleased]
-

## [2.1.7] - 2023-10-30

### Commits

- Updated .gitattributes ([8fbdefa](https://github.com/pronamic/wp-datetime/commit/8fbdefa989366b3965afb4565574a8e9e88eab25))

Full set of changes: [`2.1.6...2.1.7`][2.1.7]

[2.1.7]: https://github.com/pronamic/wp-datetime/compare/v2.1.6...v2.1.7

## [2.1.6] - 2023-10-30

### Commits

- Updated composer.json ([7ab2db5](https://github.com/pronamic/wp-datetime/commit/7ab2db5184322a31fd5b24f2d6e720fed24d3e6d))
- Removed Grunt. ([1e3bf5c](https://github.com/pronamic/wp-datetime/commit/1e3bf5c213d14b4eae36e49b9bc785d7f5058086))
- Added `if ( ! defined( 'ABSPATH' ) )`. ([81c818a](https://github.com/pronamic/wp-datetime/commit/81c818ae98a63222bf3f0f89f275b0317eb85caf))

Full set of changes: [`2.1.5...2.1.6`][2.1.6]

[2.1.6]: https://github.com/pronamic/wp-datetime/compare/v2.1.5...v2.1.6

## [2.1.5] - 2023-10-13

### Commits

- It is recommended not to use reserved keyword "object". ([b5dcf67](https://github.com/pronamic/wp-datetime/commit/b5dcf67de0584953fbb855cb7feec8589b2faf8d))
- Stand-alone post-increment statement found. ([a5a1a81](https://github.com/pronamic/wp-datetime/commit/a5a1a81bb8dfe5c33c49273ac4a81fb6af051968))

Full set of changes: [`2.1.4...2.1.5`][2.1.5]

[2.1.5]: https://github.com/pronamic/wp-datetime/compare/v2.1.4...v2.1.5

## [2.1.4] - 2023-03-27

### Commits

- Set Composer type to `wordpress-plugin`. ([9563b8e](https://github.com/pronamic/wp-datetime/commit/9563b8e4f85c3fd935cff82cd7f94ee16e021870))

Full set of changes: [`2.1.3...2.1.4`][2.1.4]

[2.1.4]: https://github.com/pronamic/wp-datetime/compare/v2.1.3...v2.1.4

## [2.1.3] - 2023-03-02
### Added

- Add .gitattributes.

Full set of changes: [`2.1.2...2.1.3`][2.1.3]

[2.1.3]: https://github.com/pronamic/wp-datetime/compare/v2.1.2...v2.1.3

## [2.1.2] - 2023-01-31
### Composer

- Changed `php` from `>=8.0` to `>=7.4`.

Full set of changes: [`2.1.1...2.1.2`][2.1.2]

[2.1.2]: https://github.com/pronamic/wp-datetime/compare/v2.1.1...v2.1.2

## [2.1.1] - 2022-12-28

### Commits

- Improve compatibility with PHP versions < 8.0. ([7842a7f](https://github.com/pronamic/wp-datetime/commit/7842a7f4978595b8341311d315c742ae66e569b8))

Full set of changes: [`2.1.0...2.1.1`][2.1.1]

[2.1.1]: https://github.com/pronamic/wp-datetime/compare/v2.1.0...v2.1.1

## [2.1.0] - 2022-12-19
- Increased minimum PHP version to version `8` or higher.
- Improved support for PHP `8.1` and `8.2`.
- Removed usage of deprecated constant `FILTER_SANITIZE_STRING`.

Full set of changes: [`2.0.3...2.1.0`][2.1.0]

[2.1.0]: https://github.com/pronamic/wp-datetime/compare/2.0.3...2.1.0

## [2.0.3] - 2022-09-27
- Update plugin version.

## [2.0.2] - 2022-09-23
- Coding standards.

## [2.0.1] - 2022-04-11
### Changed
- Coding standards.

## [2.0.0] - 2022-01-10
### Added
- Added `DateTimeTrait::create_from_interface`.

### Removed
- Removed `DateTime::create_from_mutable`.
- Removed `DateTimeImmutable::create_from_mutable`.

## [1.2.2] - 2021-08-26
- Added the character `p` to the date format characters list which was added in PHP 8.

## [1.2.1] - 2021-04-26
- Happy 2021.

## [1.2.0] - 2020-10-08
- Added DateTimeImmutable class.
- Added `DateTime::create_from_immutable( \DateTimeImmutable $object )` method.
- Added `DateTimeImmutable::create_from_mutable( \DateTime $object )` method.
- Override upstream `DateTime::createFromImmutable( $object )` method.
- Override upstream `DateTimeImmutable::createFromMutable( $object )` method.
- Override upstream `DateTimeInterface::createFromFormat( $format, $time, $timezone = null )` method.
- Updated copyright.

## [1.1.1] - 2019-12-17
- Fix for WordPress core trac ticket 48319 (https://core.trac.wordpress.org/ticket/48319).
- Updated PHP compatibility test version to PHP 5.6.
- Updated tests.

## [1.1.0] - 2019-08-26
- Introduced a format translate function, will not switch to local timezone.

## [1.0.2] - 2018-09-12
- Fixed issue on PHP 5.6 or lower.

## [1.0.1] - 2018-08-16
- Override `createFromFormat` method to return WordPress DateTime object.
- Use new `create_from_format` method instead of override, due to method signature Travis errors for different PHP versions.
- Improved support for timezones.

## 1.0.0
- First release.

[unreleased]: https://github.com/pronamic/wp-datetime/compare/2.0.0...HEAD
[2.0.3]: https://github.com/pronamic/wp-datetime/compare/2.0.2...2.0.3
[2.0.2]: https://github.com/pronamic/wp-datetime/compare/2.0.1...2.0.2
[2.0.0]: https://github.com/pronamic/wp-datetime/compare/1.2.2...2.0.0
[1.2.2]: https://github.com/pronamic/wp-datetime/compare/1.2.1...1.2.2
[1.2.1]: https://github.com/pronamic/wp-datetime/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/pronamic/wp-datetime/compare/1.1.1...1.2.0
[1.1.1]: https://github.com/pronamic/wp-datetime/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/pronamic/wp-datetime/compare/1.0.2...1.1.0
[1.0.2]: https://github.com/pronamic/wp-datetime/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/pronamic/wp-datetime/compare/1.0.0...1.0.1
33 changes: 33 additions & 0 deletions packages/pronamic/wp-datetime/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# WordPress DateTime

## WordPress Filters

### pronamic_datetime_default_format

```php
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. 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.

Source: https://developer.wordpress.org/reference/functions/date_i18n/#comment-2403

## Inspiration

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

[![Pronamic - Work with us](https://github.com/pronamic/brand-resources/blob/main/banners/pronamic-work-with-us-leaderboard-728x90%404x.png)](https://www.pronamic.eu/contact/)
77 changes: 77 additions & 0 deletions packages/pronamic/wp-datetime/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "pronamic/wp-datetime",
"description": "WordPress DateTime library.",
"license": "GPL-3.0-or-later",
"type": "wordpress-plugin",
"autoload": {
"psr-4": {
"Pronamic\\WordPress\\DateTime\\": "src"
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"koodimonni/composer-dropin-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"roots/wordpress-core-installer": true,
"bamarni/composer-bin-plugin": true
}
},
"repositories": [
{
"type": "composer",
"url": "https://wp-languages.github.io"
}
],
"require": {
"php": ">=7.4"
},
"require-dev": {
"automattic/wordbless": "^0.4.1",
"bamarni/composer-bin-plugin": "^1.4",
"koodimonni-language/de_de": "*",
"koodimonni-language/en_gb": "*",
"koodimonni-language/fr_fr": "*",
"koodimonni-language/ja": "*",
"koodimonni-language/nl_nl": "*",
"overtrue/phplint": "^9.0",
"php-coveralls/php-coveralls": "^2.4",
"php-stubs/wordpress-globals": "^0.2.0",
"phpmd/phpmd": "^2.9",
"pronamic/pronamic-cli": "^1.1",
"pronamic/wp-coding-standards": "^2.0",
"roots/wordpress": "^6.0",
"yoast/phpunit-polyfills": "^2.0"
},
"scripts": {
"coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover build/logs/clover.xml --coverage-text",
"coverage-clover": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover build/logs/clover.xml",
"coverage-html": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html build/coverage-html",
"coverage-text": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text",
"coveralls": "vendor/bin/php-coveralls -v",
"phpcbf": "XDEBUG_MODE=off vendor/bin/phpcbf",
"phpcs": "XDEBUG_MODE=off vendor/bin/phpcs -s -v",
"phplint": "vendor/bin/phplint",
"phpmd": "vendor/bin/phpmd src,tests text phpmd.ruleset.xml --suffixes php",
"phpstan": "vendor/bin/phpstan analyse --memory-limit=-1",
"phpunit": "vendor/bin/phpunit",
"post-autoload-dump": [
"mkdir -p wordpress/wp-content/languages",
"mkdir -p wordpress/wp-content/languages/plugins",
"mkdir -p wordpress/wp-content/languages/themes",
"for file in languages/*.mo ; do cp $file wordpress/wp-content/languages/plugins/ ; done",
"for file in vendor/koodimonni-language/*/* ; do cp $file wordpress/wp-content/languages/ ; done",
"for file in vendor/koodimonni-language/*/* ; do cp $file wordpress/wp-content/languages/plugins/ ; done",
"for file in vendor/koodimonni-language/*/* ; do cp $file wordpress/wp-content/languages/themes/ ; done"
],
"post-install-cmd": [
"echo 'Optionally run: composer bin all install'",
"mkdir -p wordpress/wp-content && cp vendor/automattic/wordbless/src/dbless-wpdb.php wordpress/wp-content/db.php"
],
"post-update-cmd": [
"echo 'Optionally run: composer bin all update'",
"mkdir -p wordpress/wp-content && cp vendor/automattic/wordbless/src/dbless-wpdb.php wordpress/wp-content/db.php"
],
"psalm": "vendor/bin/psalm"
}
}
Binary file not shown.
22 changes: 22 additions & 0 deletions packages/pronamic/wp-datetime/languages/pronamic-datetime-nl_NL.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2018
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: Pronamic DateTime\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-datetime\n"
"POT-Creation-Date: 2019-12-17 22:34:03+00:00\n"
"PO-Revision-Date: 2018-08-16 11:53+0100\n"
"Last-Translator: Remco Tolsma <[email protected]>\n"
"Language-Team: Pronamic <[email protected]>\n"
"Language: nl_NL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.7.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"

#: src/DateTime.php:292
msgctxt "default datetime format"
msgid "D j M Y \\a\\t H:i"
msgstr "D j M Y \\o\\m H:i"
19 changes: 19 additions & 0 deletions packages/pronamic/wp-datetime/languages/pronamic-datetime.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (C) 2019
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-datetime\n"
"POT-Creation-Date: 2019-12-17 22:34:03+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"

#: src/DateTime.php:292
msgctxt "default datetime format"
msgid "D j M Y \\a\\t H:i"
msgstr ""
21 changes: 21 additions & 0 deletions packages/pronamic/wp-datetime/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "wp-datetime",
"version": "2.1.7",
"description": "WordPress DateTime library.",
"repository": {
"type": "git",
"url": "git+https://github.com/pronamic/wp-datetime.git"
},
"keywords": [
"pronamic",
"wordpress",
"datetime",
"date",
"time"
],
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/pronamic/wp-datetime/issues"
},
"homepage": "https://github.com/pronamic/wp-datetime#readme"
}
38 changes: 38 additions & 0 deletions packages/pronamic/wp-datetime/pronamic-datetime.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Plugin Name: Pronamic DateTime
* Plugin URI: https://www.pronamic.eu/plugins/pronamic-datetime/
* Description: WordPress DateTime library.
*
* Version: 2.1.7
* Requires at least: 4.7
* Requires PHP: 7.4
*
* Author: Pronamic
* Author URI: https://www.pronamic.eu/
*
* Text Domain: pronamic-datetime
* Domain Path: /languages/
*
* License: GPL-3.0-or-later
*
* GitHub URI: https://github.com/pronamic/wp-datetime
*
* @author Pronamic <[email protected]>
* @copyright 2005-2023 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\Pay
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

/**
* Pronamic DateTime load plugin text domain.
*/
function pronamic_datetime_load_plugin_textdomain() {
load_plugin_textdomain( 'pronamic-datetime', false, basename( __DIR__ ) . '/languages' );
}

add_action( 'init', 'pronamic_datetime_load_plugin_textdomain' );
24 changes: 24 additions & 0 deletions packages/pronamic/wp-datetime/src/DateTime.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Date time
*
* @author Pronamic <[email protected]>
* @copyright 2005-2023 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\DateTime
* @see https://github.com/woocommerce/woocommerce/blob/3.3.4/includes/class-wc-datetime.php
* @see https://github.com/Rarst/wpdatetime/
*/

namespace Pronamic\WordPress\DateTime;

/**
* Date time
*
* @author Remco Tolsma
* @version 1.2.0
* @since 1.0.0
*/
class DateTime extends \DateTime implements \Pronamic\WordPress\DateTime\DateTimeInterface {
use DateTimeTrait;
}
Loading

0 comments on commit fa893a6

Please sign in to comment.