Print-to-PDF: Date Format Helpers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • blueprint
    Active Community Member
    • Jan 2019
    • 223

    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
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #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

    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    Working...