1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-01 12:08:37 -04:00

lua: Query account balances at dates

This commit is contained in:
2017-01-30 21:04:18 -05:00
parent b7d2273b1c
commit cec769b6b8
4 changed files with 112 additions and 23 deletions

View File

@ -37,6 +37,16 @@ func luaCheckTime(L *lua.LState, n int) *time.Time {
return nil
}
func luaWeakCheckTime(L *lua.LState, n int) *time.Time {
v := L.Get(n)
if ud, ok := v.(*lua.LUserData); ok {
if date, ok := ud.Value.(*time.Time); ok {
return date
}
}
return nil
}
func luaWeakCheckTableFieldInt(L *lua.LState, T *lua.LTable, n int, name string, def int) int {
lv := T.RawGetString(name)
if lv == lua.LNil {