mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-03 20:58:39 -04:00
testing: Add tests for Lua dates
Also fix a timezone bug discovered while testing
This commit is contained in:
@ -63,9 +63,10 @@ func luaWeakCheckTableFieldInt(L *lua.LState, T *lua.LTable, n int, name string,
|
||||
}
|
||||
|
||||
func luaDateNew(L *lua.LState) int {
|
||||
// TODO make this track the user's timezone
|
||||
v := L.Get(1)
|
||||
if s, ok := v.(lua.LString); ok {
|
||||
date, err := time.Parse(timeFormat, s.String())
|
||||
date, err := time.ParseInLocation(timeFormat, s.String(), time.Local)
|
||||
if err != nil {
|
||||
L.ArgError(1, "error parsing date string: "+err.Error())
|
||||
return 0
|
||||
|
Reference in New Issue
Block a user