matheval / expression-evaluator-c-sharp

Matheval is a mathematical expressions evaluator library written in C#. Allows to evaluate mathematical, boolean, string and datetime expressions
https://matheval.org/
MIT License
107 stars 29 forks source link

DATETIME or DATEVALUE function not found exception #6

Open thajib opened 1 year ago

thajib commented 1 year ago

Hi, I am not sure if this is an issue or perhaps these features are not implemented yet. But as per the documentation, date expressions are supported. When I tried a basic date expression :

                Expression expr = new Expression("DATEDIF(DATEVALUE('2021-01-31'),DATEVALUE('2029-08-29'),'Y')");
        String value = expr.Eval<String>();//The United States of America       
        Console.WriteLine(value);

I get an exception : System.Exception: Function DATEVALUE does not exist]

bls-binh commented 1 year ago

@thajib Datetime may be implemented on the future

Socratezz commented 1 year ago

@bls-binh or @matheval Do you know if there is any movement on adding dates?

The feedback I am getting from using this library is absolutely phenomenal and working with the library has been extremely easy. Amazing job from everyone involved in this one.

The business requirements I have require the date functionality that is listed at the bottom of https://matheval.org/math-expression-eval-for-c-sharp/. If there is not a plan to implement it I would like to start adding it in my fork of the repo and possibly merge it into this repo once done, but I want to ask before I start and duplicate the effort. If work has been started on it and I can be any help, let me know.

Socratezz commented 1 year ago

I have begun working on adding date functionality in this fork https://github.com/KrystalBall/expression-evaluator-c-sharp

matheval commented 1 year ago

@thajib @Socratezz I have done developed Datetime function and writing test class now. Let's wait for a few weeks

Socratezz commented 1 year ago

Thanks for the update @matheval. If I can be of any help with the tests let me know.

Socratezz commented 1 year ago

@matheval How are the tests coming along?