mirror of
https://github.com/Ed94/metadesk.git
synced 2026-07-30 11:20:06 +00:00
flesh out string -> integer functions
This commit is contained in:
@@ -352,14 +352,14 @@ MakeDateString(MD_Node *date)
|
||||
}
|
||||
}
|
||||
|
||||
if(year && month && day)
|
||||
if(!MD_NodeIsNil(year) && !MD_NodeIsNil(month) && !MD_NodeIsNil(day))
|
||||
{
|
||||
char *month_names[] =
|
||||
{
|
||||
"January", "February", "March", "April", "May", "June", "July", "August",
|
||||
"September", "October", "November", "December",
|
||||
};
|
||||
int month_idx = MD_I64FromString(month->string, 10)-1;
|
||||
MD_u64 month_idx = MD_U64FromString(month->string, 10) - 1;
|
||||
if(month_idx >= 0 && month_idx < sizeof(month_names)/sizeof(month_names[0]))
|
||||
{
|
||||
result = MD_PushStringF("%.*s %s %.*s",
|
||||
|
||||
Reference in New Issue
Block a user