Skip to content

Compare Two Datetimes #29

@draxtor

Description

@draxtor

Hello,
does this implementation supports comparing two datetimes.
I've tried this:

  1. If I check dates it always returns True
var now = DateTime.UtcNow.ToString(); 
string jsonText = "{\"<=\": [{\"var\": \"InvoiceDate.ToString()\"}, \"" + now + "\" ]}";
var now = DateTime.UtcNow.AddDays(-5).ToString("yyyy-MM-dd"); 
string jsonText = "{\"<=\": [{\"var\": \"InvoiceDate.ToString(`yyyy-MM-dd`)\"}, \"" + now + "\" ]}";
  1. Using ISO dates I'm getting exception about invalid input
now = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ"); //
jsonText = "{\"<=\": [{\"var\": \"InvoiceDate.ToString(`yyyy-MM-ddTHH:mm:ssZ`)\"}, \"" + now + "\" ]}";

  1. What is also interesting, when I use string property it fails again. Why is this "System.FormatException: 'Input string was not in a correct format.'"
{{
  "<=": [
    {
      "var": "InvoiceDateString"
    },
    "2021-07-20T16:44:12Z"
  ]
}}

Is there any way I can compare two dates?

And if the answer is yes is there a way to use functions? I would like to check against current DateTime in runtime.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions