From c7d59052428533e8ebe247897bf47d7ab84431c8 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 13 Nov 2013 19:41:54 +0000 Subject: [PATCH] Fix view format=date so that it doesn't crash on empty fields --- core/modules/widgets/view.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/view.js b/core/modules/widgets/view.js index 517616e2b..d23abe427 100755 --- a/core/modules/widgets/view.js +++ b/core/modules/widgets/view.js @@ -148,7 +148,12 @@ ViewWidget.prototype.getValueAsDoubleUrlEncoded = function() { }; ViewWidget.prototype.getValueAsDate = function(format) { - return $tw.utils.formatDateString(this.getValue(),format); + var value = this.getValue(); + if(value) { + return $tw.utils.formatDateString(value,format); + } else { + return ""; + } }; ViewWidget.prototype.getValueAsRelativeDate = function(format) {