Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date and time utilities #3247

Open
wants to merge 66 commits into
base: master
Choose a base branch
from

Commits on Nov 11, 2024

  1. Add time utilities

    Move getTime from System to Internal package and introduce a new package Time with function getTime returning a record.
    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    d7e71ab View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f235719 View commit details
    Browse the repository at this point in the history
  3. Rename TimeType components

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    61b76b0 View commit details
    Browse the repository at this point in the history
  4. Add day of week computation

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    5da7b27 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    091e0f1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    17c8421 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9ffac2d View commit details
    Browse the repository at this point in the history
  8. Integrate DateTime record from Testing lib

    ... with all dependencies on Testing and DymolaModels removed
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    ff7685c View commit details
    Browse the repository at this point in the history
  9. Integrate Duration record from Testing lib

    ... with all dependencies on Testing and DymolaModels removed
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    5a08d79 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    08555b3 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    351261b View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    663955a View commit details
    Browse the repository at this point in the history
  13. Support '-' for DateTime

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    cd03dd7 View commit details
    Browse the repository at this point in the history
  14. Add DateTime.now()

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    a5928e7 View commit details
    Browse the repository at this point in the history
  15. Add tests for Duration

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    5d8309c View commit details
    Browse the repository at this point in the history
  16. Add tests for DateTime

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    a02efee View commit details
    Browse the repository at this point in the history
  17. Format DateTime like strftime in C++ and Python

    ... but currently using only a subset of the available formatting options.
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    3d718c3 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    42e86e5 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    0219514 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    22aadfa View commit details
    Browse the repository at this point in the history
  21. Use dt as variable name for DateTimes

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    00b8a41 View commit details
    Browse the repository at this point in the history
  22. Use d as variable name for Durations

    .... and make an update regarding DateTimes as dt in Duration as well
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    04bf1b2 View commit details
    Browse the repository at this point in the history
  23. Add basic doc for DateTime

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    6d68426 View commit details
    Browse the repository at this point in the history
  24. Add basic doc for Duration

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    79acad7 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    835bec0 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    72203dd View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    aac7719 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    e6719bb View commit details
    Browse the repository at this point in the history
  29. Fix icon inheritance

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    d0a74c9 View commit details
    Browse the repository at this point in the history
  30. Rewrite using external functions from ModelicaTime.c

    * Rewrite DateTime.'constructor'.fromEpoch to utilize ModelicaTime_localtime
    * Rewrite DateTime.'String'.formatted to utilize ModelicaTime_strftime
    * Rewrite DateTime.epoch to utilize ModelicaTime_difftime
    * Add DateTime.'constructor'.fromString utilizing ModelicaTime_strptime
    
    ModelicaTime.[ch] need to be integrated to ModelicaExternalC for later distribution. During development ModelicaTime.c is directly included by the external function declaration.
    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    4cb9f66 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    7e67d9c View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    a3ab144 View commit details
    Browse the repository at this point in the history
  33. Fix C++ compilation

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    f403837 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    9fa0d91 View commit details
    Browse the repository at this point in the history
  35. Add wrappers for external functions

    Force consistency and make SimulationX happy
    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    4df6b5b View commit details
    Browse the repository at this point in the history
  36. Use horizontal ellipsis

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    b5f2de2 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    cd9e66d View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    fb46ff2 View commit details
    Browse the repository at this point in the history
  39. Make Duration constructors unambiguous

    This requires fromSeconds to be the new default.
    And it's not possible anymore to create Durations by specifying e.g. hour only.
    But unless you write tests or doc, this is not really needed I would say.
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    952df8f View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    c03619b View commit details
    Browse the repository at this point in the history
  41. Fix consideration of DST

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    2e889f0 View commit details
    Browse the repository at this point in the history
  42. Fix corner case

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    d7139e8 View commit details
    Browse the repository at this point in the history
  43. Fix subtraction test of DateTime

    Creating a Duration does not work anymore that way, due to "e547700 - Make Duration constructors unambiguous"
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    8347e21 View commit details
    Browse the repository at this point in the history
  44. Add tests for nearestInteger

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    b581a35 View commit details
    Browse the repository at this point in the history
  45. Fix naming in nearestInteger tests

    Co-Authored-By: Thomas Beutlich <[email protected]>
    m-kessler and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    f6fe248 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    2418c3e View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    4471908 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    f24d8ae View commit details
    Browse the repository at this point in the history
  49. Add another test for negative durations

    ... as the one we had did not catch negative durations with multiple days.
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    027ff80 View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    65fe3a8 View commit details
    Browse the repository at this point in the history
  51. Optionally skip DateTime tests for years before 1970

    ... as this is not supported at the moment.
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    578d1a6 View commit details
    Browse the repository at this point in the history
  52. Use class for operator record icon

    ... to fix inheritance, as its not allowed to extend from an operator record in Modelica 3.4
    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    2be014c View commit details
    Browse the repository at this point in the history
  53. Use proper comments for operators

    m-kessler authored and beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    42970c2 View commit details
    Browse the repository at this point in the history
  54. Update description

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    2b7e3af View commit details
    Browse the repository at this point in the history
  55. Configuration menu
    Copy the full SHA
    24ff399 View commit details
    Browse the repository at this point in the history
  56. Configuration menu
    Copy the full SHA
    0814655 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    26cb4ba View commit details
    Browse the repository at this point in the history
  58. Exclude past tests

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    69df1da View commit details
    Browse the repository at this point in the history
  59. Add some tests for CI

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    c3e4fd8 View commit details
    Browse the repository at this point in the history
  60. Migrate conversion to next major version

    Conversion for MSL v4.0.0 no longer is suitable, hence migrate to next major version.
    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    289aef0 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    9f388e2 View commit details
    Browse the repository at this point in the history
  62. Update CMake configuration

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    8d91779 View commit details
    Browse the repository at this point in the history
  63. Fix build errors

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    c4de094 View commit details
    Browse the repository at this point in the history
  64. Bump copyright year

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    6918dd9 View commit details
    Browse the repository at this point in the history
  65. Add include guards

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    7c6216a View commit details
    Browse the repository at this point in the history
  66. Update include annotations

    beutlich committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    059132f View commit details
    Browse the repository at this point in the history