From 3c92a71aafbcb899448f57a9058dbb653c311575 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Fri, 25 Mar 2016 22:56:26 +0000
Subject: [PATCH] bug: Date Picker

Add year to php to Date Picker (js) translation table
---
 include/class.ticket.php | 10 ++++++++--
 scp/js/scp.js            |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index 79c56e77f..8f5dd5551 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -587,16 +587,22 @@ implements RestrictedAccess, Threadable {
     }
 
     function getUpdateInfo() {
+        global $cfg;
+
         return array(
             'source'    => $this->getSource(),
             'topicId'   => $this->getTopicId(),
             'slaId'     => $this->getSLAId(),
             'user_id'   => $this->getOwnerId(),
             'duedate'   => $this->getDueDate()
-                ? Format::date($this->getDueDate())
+                ? Format::date($this->getDueDate(), true,
+                    $cfg->getDateFormat(true))
+                : '',
+            'time'      => $this->getDueDate()
+                ? Format::time($this->getDueDate(), true, 'HH:mm')
                 : '',
-            'time'      => $this->getDueDate()?(Format::date($this->getDueDate(), true, 'HH:mm')):'',
         );
+
     }
 
     function getLock() {
diff --git a/scp/js/scp.js b/scp/js/scp.js
index 2e6a116be..1e2dfa304 100644
--- a/scp/js/scp.js
+++ b/scp/js/scp.js
@@ -542,6 +542,7 @@ $.translate_format = function(str) {
         'yyyy': '`',
         'yyy':  '`',
         'yy':   'y',
+        'y':    'yy',
         '`':    'yy'
     };
     // Change PHP formats to datepicker ones
-- 
GitLab