1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Removed uneeded function but still converts TW5 Date strings.

This commit is contained in:
Roma Hicks 2015-03-13 13:12:18 -05:00
parent a5591dc7a5
commit 55ee327885
2 changed files with 2 additions and 16 deletions

View File

@ -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);

View File

@ -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);
}
}