mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-21 12:59:50 -06:00
FF-1680: New flow elements for file/folder dates
This commit is contained in:
@@ -138,12 +138,15 @@ public class DirectoryDateCompare : Node
|
||||
}
|
||||
|
||||
// then it must be a between or not between
|
||||
var minutes = now.Subtract(date).TotalMinutes;
|
||||
int low = Math.Min(DateComparision.Value1, DateComparision.Value2);
|
||||
int high = Math.Max(DateComparision.Value1, DateComparision.Value2);
|
||||
bool isBetween = minutes >= low && minutes <= high;
|
||||
int high = Math.Max(DateComparision.Value1, DateComparision.Value2);
|
||||
|
||||
DateTime lowDate = now.AddMinutes(-low);
|
||||
DateTime highDate = now.AddMinutes(-high);
|
||||
|
||||
bool isBetween = now >= lowDate && now <= highDate;
|
||||
args.Logger?.ILog(
|
||||
$"Date is {(isBetween ? "" : "not ")}between {low} minutes and {high} minutes");
|
||||
$"Date is {(isBetween ? "" : "not ")}between {lowDate:yyyy-MM-ddTHH:mm:ss}Z and {highDate:yyyy-MM-ddTHH:mm:ss}Z");
|
||||
|
||||
if (DateComparision.Comparison is DateCompareMode.Between)
|
||||
{
|
||||
|
||||
@@ -134,12 +134,15 @@ public class FileDateCompare : Node
|
||||
}
|
||||
|
||||
// then it must be a between or not between
|
||||
var minutes = now.Subtract(date).TotalMinutes;
|
||||
int low = Math.Min(DateComparision.Value1, DateComparision.Value2);
|
||||
int high = Math.Max(DateComparision.Value1, DateComparision.Value2);
|
||||
bool isBetween = minutes >= low && minutes <= high;
|
||||
int high = Math.Max(DateComparision.Value1, DateComparision.Value2);
|
||||
|
||||
DateTime lowDate = now.AddMinutes(-low);
|
||||
DateTime highDate = now.AddMinutes(-high);
|
||||
|
||||
bool isBetween = now >= lowDate && now <= highDate;
|
||||
args.Logger?.ILog(
|
||||
$"Date is {(isBetween ? "" : "not ")}between {low} minutes and {high} minutes");
|
||||
$"Date is {(isBetween ? "" : "not ")}between {lowDate:yyyy-MM-ddTHH:mm:ss}Z and {highDate:yyyy-MM-ddTHH:mm:ss}Z");
|
||||
|
||||
if (DateComparision.Comparison is DateCompareMode.Between)
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
},
|
||||
"Fields": {
|
||||
"Path": "Path",
|
||||
"Path-Help": "The path to the file to check. Leave empty to check the current working file.\nIf a file is specified the directory containing the file will be checked.",
|
||||
"Path-Help": "The path to the folder to check. Leave empty to check the current working file.\nIf a file is specified the directory containing the file will be checked.",
|
||||
"Date": "Date",
|
||||
"DateComparision": "Comparision"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user