Added function description
This commit is contained in:
parent
7d2ceedc9a
commit
bcc185bf5d
@ -68,7 +68,10 @@ char *lastIndexOf(char *str, const char character)
|
|||||||
return last;
|
return last;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The monthNumTo3LetterAbbreviation function takes the month number from 1 to 12 and returns the abbreviation in a 3 letter
|
||||||
|
* format.
|
||||||
|
*/
|
||||||
char *monthNumTo3LetterAbbreviation(char *buffer, const uint8_t monthNumber)
|
char *monthNumTo3LetterAbbreviation(char *buffer, const uint8_t monthNumber)
|
||||||
{
|
{
|
||||||
static const char monthArray[][4] = {{"Jan"},{"Feb"},{"Mar"},{"Apr"},{"May"},{"Jun"},{"Jul"},{"Aug"},{"Sep"},{"Oct"},{"Nov"},{"Dec"}};
|
static const char monthArray[][4] = {{"Jan"},{"Feb"},{"Mar"},{"Apr"},{"May"},{"Jun"},{"Jul"},{"Aug"},{"Sep"},{"Oct"},{"Nov"},{"Dec"}};
|
||||||
@ -77,7 +80,7 @@ char *monthNumTo3LetterAbbreviation(char *buffer, const uint8_t monthNumber)
|
|||||||
|
|
||||||
if(monthNumber >= 1 && monthNumber <= 12)
|
if(monthNumber >= 1 && monthNumber <= 12)
|
||||||
strcpy_P(buffer, monthArray[monthNumber-1]);
|
strcpy_P(buffer, monthArray[monthNumber-1]);
|
||||||
else //Default is january
|
else //If the month number is garbage, we return the first month of the year
|
||||||
strcpy_P(buffer, monthArray[0]);
|
strcpy_P(buffer, monthArray[0]);
|
||||||
|
|
||||||
return buffer;
|
return buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user