0.1.2 dateTimeHelpers

This commit is contained in:
rob tillaart 2023-01-18 16:09:51 +01:00
parent aceae77552
commit 751a850b70
5 changed files with 17 additions and 13 deletions

View File

@ -20,9 +20,9 @@ compile:
# - due # - due
# - zero # - zero
# - leonardo # - leonardo
# - m4 - m4
# - esp32 - esp32
# - esp8266 - esp8266
# - mega2560 # - mega2560
# - rpipico - rpipico

View File

@ -6,12 +6,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.1] - 2023-03-07 ## [0.1.2] - 2023-01-18
- fix build (PM is a reserved word on M4 / samd platform)
- minor fix changelog.md
## [0.1.1] - 2023-01-07
- initial release - initial release
- clean up first version - clean up first version
- add examples - add examples
## [0.1.0] - 2020-07-01 ## [0.1.0] - 2020-07-01
- initial version - initial version

View File

@ -2,7 +2,7 @@
// //
// FILE: datetimeHelpers.h // FILE: datetimeHelpers.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.1 // VERSION: 0.1.2
// PURPOSE: Arduino library with date time helper functions. // PURPOSE: Arduino library with date time helper functions.
// DATE: 2020-07-01 // DATE: 2020-07-01
// URL: https://github.com/RobTillaart/dateTimeHelpers // URL: https://github.com/RobTillaart/dateTimeHelpers
@ -145,7 +145,7 @@ char * seconds2clock12(uint32_t seconds, bool displaySeconds = false)
// (false) 00:00 .. 12:59 AM/PM // (false) 00:00 .. 12:59 AM/PM
char * seconds2clockAMPM(uint32_t seconds, bool displaySeconds = false) char * seconds2clockAMPM(uint32_t seconds, bool displaySeconds = false)
{ {
bool PM = false; bool PMflag = false;
char * buf = __dateTimeHelperBuffer; char * buf = __dateTimeHelperBuffer;
uint8_t pos = 0; uint8_t pos = 0;
@ -155,7 +155,7 @@ char * seconds2clockAMPM(uint32_t seconds, bool displaySeconds = false)
if (hours >= 12) if (hours >= 12)
{ {
PM = true; PMflag = true;
if (hours > 12) hours -= 12; if (hours > 12) hours -= 12;
} }
uint8_t t = hours / 10; uint8_t t = hours / 10;
@ -175,7 +175,7 @@ char * seconds2clockAMPM(uint32_t seconds, bool displaySeconds = false)
} }
buf[pos++] = ' '; buf[pos++] = ' ';
if (PM) buf[pos++] = 'P'; if (PMflag == true) buf[pos++] = 'P';
else buf[pos++] = 'A'; else buf[pos++] = 'A';
buf[pos++] = 'M'; buf[pos++] = 'M';
buf[pos] = '\0'; buf[pos] = '\0';

View File

@ -15,7 +15,7 @@
"type": "git", "type": "git",
"url": "https://github.com/RobTillaart/dateTimeHelpers.git" "url": "https://github.com/RobTillaart/dateTimeHelpers.git"
}, },
"version":"0.1.1", "version":"0.1.2",
"frameworks": "arduino", "frameworks": "arduino",
"platforms": "*" "platforms": "*"
} }

View File

@ -1,5 +1,5 @@
name=dateTimeHelpers name=dateTimeHelpers
version=0.1.1 version=0.1.2
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library with date and time helper functions. sentence=Arduino library with date and time helper functions.
@ -7,5 +7,5 @@ paragraph=
category=Data Processing category=Data Processing
url=https://github.com/RobTillaart/dateTimeHelpers url=https://github.com/RobTillaart/dateTimeHelpers
architectures=* architectures=*
includes=datetimeHelpers.h includes=dateTimeHelpers.h
depends= depends=