mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:30:06 +00:00
Refactor clock format to wxdata
This commit is contained in:
parent
bb287dad9c
commit
a7cb459e20
6 changed files with 42 additions and 33 deletions
|
|
@ -9,8 +9,12 @@
|
|||
#endif
|
||||
|
||||
#include <scwx/util/time.hpp>
|
||||
#include <scwx/util/enum.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
# include <date/date.h>
|
||||
|
|
@ -21,6 +25,18 @@ namespace scwx
|
|||
namespace util
|
||||
{
|
||||
|
||||
static const std::unordered_map<ClockFormat, std::string> clockFormatName_ {
|
||||
{ClockFormat::_12Hour, "12-hour"},
|
||||
{ClockFormat::_24Hour, "24-hour"},
|
||||
{ClockFormat::Unknown, "?"}};
|
||||
|
||||
SCWX_GET_ENUM(ClockFormat, GetClockFormat, clockFormatName_)
|
||||
|
||||
const std::string& GetClockFormatName(ClockFormat clockFormat)
|
||||
{
|
||||
return clockFormatName_.at(clockFormat);
|
||||
}
|
||||
|
||||
std::chrono::system_clock::time_point TimePoint(uint32_t modifiedJulianDate,
|
||||
uint32_t milliseconds)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue