~aleteoryx/muditaos

ref: be66c108884ef3337071c7f66ab2c137df48d00b muditaos/module-apps/application-calendar/models/MonthModel.hpp -rw-r--r-- 1005 bytes
be66c108 — Tomek Sobkowiak [EGD-5347] Replace filelength with file_size 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "windows/AppWindow.hpp"
#include "Application.hpp"
#include <gui/widgets/GridLayout.hpp>
#include <gui/widgets/Item.hpp>
#include <Text.hpp>
#include <module-utils/date/include/date/date.h>
#include <map>
#include <string>
#include <vector>
#include <module-apps/application-calendar/data/dateCommon.hpp>

class MonthModel
{
  public:
    date::month month;
    unsigned int lastDay;
    // first week offset
    uint32_t firstWeekDayNumb;
    date::year year;

  public:
    MonthModel(date::year_month_day ymd);
    MonthModel()          = default;
    virtual ~MonthModel() = default;

    date::year getYear();
    date::month getMonth();
    uint32_t getLastDay();
    uint32_t getFirstWeekOffset();
    std::string getMonthYearText();
    std::string getMonthText();
    std::vector<std::string> split(const std::string &s, char delim);
};