Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datetime formats #4539

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Commits on Dec 29, 2017

  1. Partial Fix: Field type 'Datetime' - format customization missing key…

    …stonejs#3160
    
    Properties in DatetimeType were not being carried through to
    DatetimeField. Now resolved.
    
    format property replaced by dateFormat and timeFormat properties.
    
    Requires properly set parseFormat property (inclusing time zone format
    (Z) to function correctly. We should be able to calculate this based on
    the dateFormat and timeFormat properties and pass through form the Type
    to the Field.
    gsteinert committed Dec 29, 2017
    Configuration menu
    Copy the full SHA
    f4f2e20 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2017

  1. In DatetimeType, add tzFormat option to control timezone format strin…

    …g instead of hardcoding in DatetimeField.
    
    Updated validation for options to reflect change from format to dateFormat, timeFormat and tzFormat.
    gsteinert committed Dec 30, 2017
    Configuration menu
    Copy the full SHA
    e488b47 View commit details
    Browse the repository at this point in the history
  2. In DatetimeType, automatically calculate a parseFormat to suit the

    dateFormat, timeFormat and tzFormat specified.
    
    This removes the requirement for a parseFormat option to be specified.
    
    The parseFormat option is still available, and if supplied is appended
    along with the calculated format to the default list.
    gsteinert committed Dec 30, 2017
    Configuration menu
    Copy the full SHA
    8d49628 View commit details
    Browse the repository at this point in the history
  3. Update Datetime field docs.

    gsteinert committed Dec 30, 2017
    Configuration menu
    Copy the full SHA
    57f8b2a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9e9fed8 View commit details
    Browse the repository at this point in the history
  5. FIX: Field type 'Datetime' - format customization missing keystonejs#…

    …3160
    
    Placeholder for time field now displays correct format.
    gsteinert committed Dec 30, 2017
    Configuration menu
    Copy the full SHA
    8f36861 View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2017

  1. Clone parseFormats array in DatetimeType. Failing to do so results in

    the same array being shared by all Datetime field instances.
    
    Fixed test 'should throw when format is not a string'. Now fails if
    exception is not thrown, rather than timing out.
    gsteinert committed Dec 31, 2017
    Configuration menu
    Copy the full SHA
    b1efb93 View commit details
    Browse the repository at this point in the history
  2. Updated Datetime tests to reflect change of format to dateFormat,

    timeFormat and tzFormat.
    gsteinert committed Dec 31, 2017
    Configuration menu
    Copy the full SHA
    f6b1890 View commit details
    Browse the repository at this point in the history
  3. Added test to cover validation of a custom display format.

    Altered test for validation of the default format when a parseFormat
    is specified.
    
    Previously, if a parseFormat is specified, this became the only
    acceptable format, even if a different display format is defined.
    If the display format differs from the parse format, the field will
    not validate as populated from the database.
    
    Now, if a parseFormat (or formats, in an array) is specified it will
    be added to the list of acceptable formats (the default array plus
    the display format).
    gsteinert committed Dec 31, 2017
    Configuration menu
    Copy the full SHA
    992f370 View commit details
    Browse the repository at this point in the history
  4. Linting

    gsteinert committed Dec 31, 2017
    Configuration menu
    Copy the full SHA
    be45c07 View commit details
    Browse the repository at this point in the history