Skip to content

FieldtypeComments ignores 'dateFormat' setting from module config #299

@Toutouwai

Description

@Toutouwai

Short description of the issue

The comments list uses the "relative" option for the comment date/time even when a date format is specified in the "Date/time format (for comment list)" config setting.

Expected behavior

If nothing contrary is specified in the $options array when rendering the comments list, the setting defined in the module config is used.

Actual behavior

A relative time is always shown in the comments list (unless a date format is supplied in an $options array is supplied when the comments list is rendered).

Optional: Screenshots/Links that demonstrate the issue

This setting is ignored:

2017-06-26_110246

Optional: Suggestion for a possible fix

Check the field settings when defining the defaults:

$defaultOptions = array(
    'useGravatar' => ($this->field ? $this->field->get('useGravatar') : ''),
    'useVotes' => ($this->field ? $this->field->get('useVotes') : 0),
    'useStars' => ($this->field ? $this->field->get('useStars') : 0),
    'depth' => ($this->field ? (int) $this->field->get('depth') : 0),   
    //'dateFormat' => 'relative',
    'dateFormat' => ($this->field ? $this->field->get('dateFormat') : 'relative'),
    );

Setup/Environment

  • ProcessWire version: 3.0.63

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions