mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 20:10:03 +00:00
Removed uneeded function but still converts TW5 Date strings.
This commit is contained in:
parent
a5591dc7a5
commit
55ee327885
@ -24,16 +24,9 @@ exports.eachday = function(source,operator,options) {
|
|||||||
value = (new Date(value)).setHours(0,0,0,0);
|
value = (new Date(value)).setHours(0,0,0,0);
|
||||||
return value+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) {
|
source(function(tiddler,title) {
|
||||||
if(tiddler && tiddler.fields[fieldName]) {
|
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) {
|
if(values.indexOf(value) === -1) {
|
||||||
values.push(value);
|
values.push(value);
|
||||||
results.push(title);
|
results.push(title);
|
||||||
|
@ -23,16 +23,9 @@ exports.sameday = function(source,operator,options) {
|
|||||||
var isSameDay = function(dateField) {
|
var isSameDay = function(dateField) {
|
||||||
return (new Date(dateField)).setHours(0,0,0,0) === targetDate;
|
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) {
|
source(function(tiddler,title) {
|
||||||
if(tiddler && tiddler.fields[fieldName]) {
|
if(tiddler && tiddler.fields[fieldName]) {
|
||||||
if(isSameDay(toDateObj(tiddler.fields[fieldName]))) {
|
if(isSameDay($tw.utils.parseDate(tiddler.fields[fieldName]))) {
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user