(' . _t('SilverStripe\\Forms\\DateField.NOTSET', 'not set') . ')'; $value = $this->dataValue(); if ($value) { $value = $this->tidyInternal($value); $df = new DBDate($this->name); $df->setValue($value); if ($df->IsToday()) { // e.g. 2018-06-01 (today) $format = '%s (%s)'; $infoComplement = _t('SilverStripe\\Forms\\DateField.TODAY', 'today'); } else { // e.g. 2018-06-01, 5 days ago $format = '%s, %s'; $infoComplement = $df->Ago(); } // Render the display value with some complement of info $displayValue = Convert::raw2xml(sprintf( $format ?? '', $this->Value(), $infoComplement )); } return sprintf( "%s", $this->ID(), $displayValue ); } public function Type() { return "date_disabled readonly " . parent::Type(); } public function getHTML5() { // Always disable HTML5 feature when using the readonly field. return false; } }