Problem/Motivation
I investigate why our view with many dates needs so much time. And I saw that
\Drupal\Core\Datetime\DateFormatter::dateFormat via \Drupal\Core\Datetime\DateFormatter::format was called very often.
\Drupal\smart_date\SmartDateTrait use \Drupal\Core\Datetime\DateFormatter::format.
\Drupal\Core\Datetime\DateFormatter::dateFormat is called when it is not type custom.
, but \Drupal\smart_date\SmartDateTrait set this to empty string, which results into unnecessary calls.
See attached screenshots, before and after the fix.
Steps to reproduce
-
Proposed resolution
Set missing date time type to custom.
Remaining tasks
-
User interface changes
-
API changes
-
Data model changes
-
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | smart_date-missing-date-type.before.png | 208.5 KB | tobiasb |
| smart_date-missing-date-type.after_.png | 195.03 KB | tobiasb |
Issue fork smart_date-3519986
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tobiasbComment #3
tobiasbComment #5
tobiasb