partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 806256a17f61e3e057cc1022092dee707728fadd
parent f9e1a4889d2115bc2b7987346f8e9fcf4886c828
Author: Felicitus <felicitus@felicitus.org>
Date:   Fri, 11 Sep 2015 19:06:11 +0200

Added override for Ext.data.field.Date to return ISO8601 format by default

Diffstat:
Asrc/PartKeepr/FrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.data.field.Date-ISO8601.js | 11+++++++++++
Msrc/PartKeepr/FrontendBundle/Resources/views/index.html.twig | 1+
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.data.field.Date-ISO8601.js b/src/PartKeepr/FrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.data.field.Date-ISO8601.js @@ -0,0 +1,11 @@ +/** + * Overrides the Date field to return the date in ISO 8601 format by default + */ +Ext.define("PartKeepr.data.field.Date", { + override: "Ext.data.field.Date", + + serialize: function (value) + { + return value.toISOString(); + } +}); diff --git a/src/PartKeepr/FrontendBundle/Resources/views/index.html.twig b/src/PartKeepr/FrontendBundle/Resources/views/index.html.twig @@ -42,6 +42,7 @@ '@PartKeeprFrontendBundle/Resources/public/js/Data/field/Array.js' '@PartKeeprFrontendBundle/Resources/public/js/Data/HydraModel.js' '@PartKeeprFrontendBundle/Resources/public/js/Data/HydraTreeModel.js' + '@PartKeeprFrontendBundle/Resources/public/js/ExtJS/Enhancements/Ext.data.field.Date-ISO8601.js' %} <script type="text/javascript" src="{{ asset_url }}"></script>