From 55ee327885804b0c79f592aaba68ac23eaca6e7e Mon Sep 17 00:00:00 2001 From: Roma Hicks Date: Fri, 13 Mar 2015 13:12:18 -0500 Subject: [PATCH] Removed uneeded function but still converts TW5 Date strings. --- core/modules/filters/eachday.js | 9 +-------- core/modules/filters/sameday.js | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/core/modules/filters/eachday.js b/core/modules/filters/eachday.js index 27a20ec3d..6fdccf879 100644 --- a/core/modules/filters/eachday.js +++ b/core/modules/filters/eachday.js @@ -24,16 +24,9 @@ exports.eachday = function(source,operator,options) { value = (new Date(value)).setHours(0,0,0,0); return value+0; }; - // Convert ISO date string to Date object if needed. - var toDateObj = function(value) { - if(!(value instanceof Date)) { - value = new Date($tw.utils.parseDate(value)); - } - return value; - }; source(function(tiddler,title) { if(tiddler && tiddler.fields[fieldName]) { - var value = toDate(toDateObj(tiddler.fields[fieldName])); + var value = toDate($tw.utils.parseDate(tiddler.fields[fieldName])); if(values.indexOf(value) === -1) { values.push(value); results.push(title); diff --git a/core/modules/filters/sameday.js b/core/modules/filters/sameday.js index c97f6c2f2..e1700d11e 100644 --- a/core/modules/filters/sameday.js +++ b/core/modules/filters/sameday.js @@ -23,16 +23,9 @@ exports.sameday = function(source,operator,options) { var isSameDay = function(dateField) { return (new Date(dateField)).setHours(0,0,0,0) === targetDate; }; - // Convert ISO date string to Date object if needed. - var toDateObj = function(value) { - if(!(value instanceof Date)) { - value = new Date($tw.utils.parseDate(value)); - } - return value; - }; source(function(tiddler,title) { if(tiddler && tiddler.fields[fieldName]) { - if(isSameDay(toDateObj(tiddler.fields[fieldName]))) { + if(isSameDay($tw.utils.parseDate(tiddler.fields[fieldName]))) { results.push(title); } }