You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi All,
Using orbit to develop a small wiki-type application,
I was given an error whenver I tried to parse something with the DATE field.
It did not have a parser for it. So I edited orbit/model.lua, and basically copied the datetime function.
Here is a diff, if you are interested in adding support for DATE:
98a99,102> function convert.date(v)> local year, month, day = string.match(v, "(%d+)%-(%d+)%-(%d+)")> return os.time({year=tonumber(year), month=tonumber(month), day=tonumber(day)})> end153a158,161>> function escape.date(v)> return "'" .. os.date("%Y-%m-%d", v) .. "'"> end
I had a few concerns about it.
There is no difference between date and datetime in lua, this could possibly lead to bugs in programs that rely on a time (Since it would be noon, but are only given a date. Hopefully the developer would be aware of that though.
Is it possible to use datetime for date? I tried, but I get the following:
/usr/share/lua/5.1/orbit/model.lua:93: field 'day' missing in date table
This seems to be because of the expression you use to find date. it is (%d+)%-(%d+)%-(%d+) (%d+):(%d+):(%d+)
This means that the day will not be matched for type date, since it does not follow a space. I don't know if you would prefer modifying the expression, or adding a separate function.
Either way, we would want a different function for escape.date.
Is there any reason DATE is not supported? Or is it just waiting for someone to bake support in?
Let me know what you guys think. If you want, I can fork and do a PR, but I don't speak git very well.
Happy new year!
The text was updated successfully, but these errors were encountered:
I notice that this project isn't very active.
Perhaps @hishamhm can tell me if orbit is still developed.
If it isn't, and there isn't a replacement we should be switching to, I would be willing to maintain it in some fashion, though I have not maintained anything before.
I am writing a project in orbit though, and so it is in my best interest to make sure it is maintained.
Thanks!
Hi All,
Using orbit to develop a small wiki-type application,
I was given an error whenver I tried to parse something with the DATE field.
It did not have a parser for it. So I edited orbit/model.lua, and basically copied the datetime function.
Here is a diff, if you are interested in adding support for DATE:
I had a few concerns about it.
This seems to be because of the expression you use to find date. it is
(%d+)%-(%d+)%-(%d+) (%d+):(%d+):(%d+)
This means that the day will not be matched for type date, since it does not follow a space. I don't know if you would prefer modifying the expression, or adding a separate function.
Either way, we would want a different function for escape.date.
Is there any reason DATE is not supported? Or is it just waiting for someone to bake support in?
Let me know what you guys think. If you want, I can fork and do a PR, but I don't speak git very well.
Happy new year!
The text was updated successfully, but these errors were encountered: