Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

extras/ShortDate: i18n

  • Loading branch information...
commit a2b82e9a5f98ef61099b3ad912d4b2ef89a98d77 1 parent 37df162
@jerstlouis jerstlouis authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 extras/types/ShortDate.ec
View
13 extras/types/ShortDate.ec
@@ -4,20 +4,21 @@ public import static "ecere"
public import "ecere"
#endif
+static Array<String> shortMonths
+{ [
+ $"Jan", $"Feb", $"Mar", $"Apr", $"May", $"Jun", $"Jul", $"Aug", $"Sep", $"Oct", $"Nov", $"Dec"
+] };
+
public struct ShortDate : Date
{
char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
{
- static const char months[12][4] =
- {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
- };
if(day || month || year)
{
if(month >= january && month <= december)
- sprintf(stringOutput, "%s %d, %d", months[month], day, year);
+ sprintf(stringOutput, "%s %d, %d", shortMonths[month], day, year);
else
- strcpy(stringOutput, "Invalid date");
+ strcpy(stringOutput, $"Invalid date");
}
else
stringOutput[0] = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.