Files
MuditaOS/module-utils/time
Alek-Mudita 1446a4bff8 Egd 2539 duration class (#258)
* [GED-2539] Timestamp : changed buffer to heap one

[EGD-2539] implemented 1st version of Duration class

[EGD-2539] added autoformating of the output

[EGD-2539] clean up

[EGD-2539] used duration in call and calllog
added Duration operators

[EGD-2539] add better duartions to calllog.db

[EGD-2539] format file

* [EGD-2539] fixes after rebase

* [EGD-2539] displayed format follows design guidline

* [EGD-2539] added UT for duration class and necessary FW fixes

* [EGD-2539] fixed tim_conversion UT

* [EGD-2539] PR fixes

* [EGD-2539] added move constructor to UTF8 class

* [EGD-2539] added checking for nullptr in fillContactData

* [EGD-2539] PR fixes
2020-03-25 17:14:00 +01:00
..

Time conversion utility

Why?

  • There is no locale except C-Locale available in stdlib nano and we need time conversions.
  • stdlibnano doesn't provide a way to sustitute C-Locale (it's static)

How?

There is C-Locale builtin, therefore it's used to convert time whenever possible.
When it's not -> specifiers are substituted with our locale (i18 map)

    +------------+     +--------+
    |  Timestamp | <=> | Locale |
    +------------+     +--------+
          *
          |
    +------------+
    |  DateTime  |
    +------------+
        *     *
       /       \
      /         \
 +------+     +------+
 | Time |     | Date |
 +------+     +------+

Locale - (utils::time::Locale) class for i18n Timestamp internationalization management
Timestamp - general class to store time data. Init with a EPOCH timestamp. Has input and output formatters.
DateTime - class for most of possible usecases, initialized with system clock, can return time/date string in reference to past Date - just a subclass with a default formatter returning the date in particular Time - just a subclass with a default formatter returning the time, regardless of the date (today/yesterday/5 days ago)

For more see headers