oridb / mc

Myrddin Compiler
MIT License
388 stars 34 forks source link

"out of bounds access" when using custom formatting with weekday modifiers #148

Closed FrankRuben closed 6 years ago

FrankRuben commented 6 years ago

Hi,

when using some code similar to the formatting sample in the library documentation, I'm getting an "out of bounds access" error. This can be fixed by changing the following lines in ~/date/fmt.myr (from d.day to d.wday):

    | 'a':  std.sbfmt(sb, "{}", _names.abbrevday[d.wday])
    | 'A':  std.sbfmt(sb, "{}", _names.fullday[d.wday])

HTH, Frank

oridb commented 6 years ago

Fixed, and added tests. Feel free to send a pull request next time, or toss a patch on the mailing list.