1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-23 23:46:52 +00:00

Fix problem with view widget relativedate format

Fixes #319
This commit is contained in:
Jermolene 2013-12-30 13:08:48 +00:00
parent 6d6e8afb9c
commit d043bdd289

View File

@ -158,8 +158,8 @@ ViewWidget.prototype.getValueAsDate = function(format) {
};
ViewWidget.prototype.getValueAsRelativeDate = function(format) {
var value = this.getValue();
if(value) {
var value = $tw.utils.parseDate(this.getValue());
if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") {
return $tw.utils.getRelativeDate((new Date()) - (new Date(value))).description;
} else {
return "";