MantisBT: master b155dbfb

Author Committer Branch Timestamp Parent
dregad dregad master 2025-02-26 18:43 master c5fba7f4
Affected Issues  0034928: Date conversion fails using a non-US date format in VersionUpdateCommand.php
 0036818: Call to undefined function date_timestamp_to_iso8601()
Changeset

New API functions for date conversions

As requested in PR review, it is no longer possible to provide timestamp
(version date order) as an integer to REST API /projects/{{id}}/versions
endpoints.

It is worth noting that a Unix timestamp can technically still be given,
using the @{integer} syntax, since that is a valid format for the
DateTimeImmutable constructor. This could change in the future, if we
decide to only allow ISO-8601 format.

The datetime parsing and generation logic has been standardized in 2 new
date API functions:

  • date_string_to_timestamp()
  • date_timestamp_to_iso8601()

Use the new functions in:

  • date_strtotime()
  • ApiObjectFactory: methods datetime() and datetimeString();
    add new dateStringToTimestamp() method.
  • VersionAddCommand
  • VersionUpdateCommand

Fixes 0034928

mod - api/soap/mc_api.php Diff File
mod - core/commands/VersionAddCommand.php Diff File
mod - core/commands/VersionUpdateCommand.php Diff File
mod - core/date_api.php Diff File
mod - manage_proj_ver_update.php Diff File