Giter Club home page Giter Club logo

Comments (8)

grulisco avatar grulisco commented on July 23, 2024

Hi @RML-IAEA: What is the problem here? Does the example above work or not?
BTW better ask configuration questions at https://community.senaite.org

from senaite.core.

RML-IAEA avatar RML-IAEA commented on July 23, 2024

Hi grulisco, "It doesn't work at all. Datetime is not accepted in Senaite calculations

from senaite.core.

grulisco avatar grulisco commented on July 23, 2024

Hi @RML-IAEA; I do not know how your datetime functions are working exactly. If the result of the expression is a string, it should work IMO.
Alternatively you can setup almighty "external calculations", see https://www.senaite.com/docs/analysis-calculations#external-calculations

from senaite.core.

RML-IAEA avatar RML-IAEA commented on July 23, 2024

It only accepts float or integer values, not strings.

from senaite.core.

grulisco avatar grulisco commented on July 23, 2024

Don't know then. Maybe your date result isn't a string yet.

We're working with calculated string expressions successfully.

Basically an entry like "This is a string" as calculation formula should return this string as result.

We have several cases like "This string" if [condition] else "Other string".

from senaite.core.

RML-IAEA avatar RML-IAEA commented on July 23, 2024

How can you calculate the difference in days between datetimes inside the Senaite calculations section?

from senaite.core.

grulisco avatar grulisco commented on July 23, 2024

see #2446 (comment)

from senaite.core.

grulisco avatar grulisco commented on July 23, 2024

Simple datetime calcs work; try e.g. calculating number of days waiting for chrismas:
(datetime(2023,12,24)-datetime.today()).days

So the problem seems converting datetime data in a proper way.

from senaite.core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.