Announcement

Collapse
No announcement yet.

Print-to-PDF: Date Format Helpers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Print-to-PDF: Date Format Helpers

    It would be nice to have some helper functions which could format dates in a variety of ways.

    For example:

    16 May 2019
    December 21st 2010
    Monday 9th January 2017

    Etc

  • #2
    Hello
    copy \Espo\Core\Htmlizer\Htmlizer to custom folder
    overide function render. (remove all other function)
    add helper so :

    PHP Code:
    'secondsToHHmm' => function ($context$options) {
                         if (
    $context && isset($context[0])) {
                            
    $hours floor($context[0] / 3600);
                            
    $minutes floor(($context[0] / 60) % 60);
                            return 
    $hours .',' .$minutes;
                        }
                        return;
                    }, 
    I don't know if good practice ... but work

    Comment

    Working...
    X