webmcp

diff libraries/mondelefant/mondelefant_atom_connector.lua @ 1:985024b16520

Version 1.0.1

New feature: JSON requests

Changes in ui.paginate: Current page setting is directly fetched from CGI params, instead of view params

Changed behavior of load methods of atom library to accept nil as input

Bugfixes in mondelefant_atom_connector timestamp(tz) loaders

Added global constant _WEBMCP_VERSION containing a version string
author jbe
date Tue Nov 17 12:00:00 2009 +0100 (2009-11-17)
parents 9fdfb27f8e67
children 3d43a5cf17c1
line diff
     1.1 --- a/libraries/mondelefant/mondelefant_atom_connector.lua	Sun Oct 25 12:00:00 2009 +0100
     1.2 +++ b/libraries/mondelefant/mondelefant_atom_connector.lua	Tue Nov 17 12:00:00 2009 +0100
     1.3 @@ -100,12 +100,15 @@
     1.4  output_converters.date = function(str) return atom.date:load(str) end
     1.5  
     1.6  local timestamp_loader_func = function(str)
     1.7 -  local hour, minute, second = string.match(
     1.8 +  local year, month, day, hour, minute, second = string.match(
     1.9      str,
    1.10 -    "^([0-9]?[0-9]):([0-9][0-9]):([0-9][0-9])"
    1.11 +    "^([0-9][0-9][0-9][0-9])%-([0-9][0-9])%-([0-9][0-9]) ([0-9]?[0-9]):([0-9][0-9]):([0-9][0-9])"
    1.12    )
    1.13 -  if hour then
    1.14 +  if year then
    1.15      return atom.timestamp{
    1.16 +      year   = tonumber(year),
    1.17 +      month  = tonumber(month),
    1.18 +      day    = tonumber(day),
    1.19        hour   = tonumber(hour),
    1.20        minute = tonumber(minute),
    1.21        second = tonumber(second)
    1.22 @@ -118,15 +121,12 @@
    1.23  output_converters.timestamptz = timestamp_loader_func
    1.24  
    1.25  local time_loader_func = function(str)
    1.26 -  local year, month, day, hour, minute, second = string.match(
    1.27 +  local hour, minute, second = string.match(
    1.28      str,
    1.29 -    "^([0-9][0-9][0-9][0-9])%-([0-9][0-9])%-([0-9][0-9]) ([0-9]?[0-9]):([0-9][0-9]):([0-9][0-9])"
    1.30 +    "^([0-9]?[0-9]):([0-9][0-9]):([0-9][0-9])"
    1.31    )
    1.32 -  if year then
    1.33 +  if hour then
    1.34      return atom.time{
    1.35 -      year   = tonumber(year),
    1.36 -      month  = tonumber(month),
    1.37 -      day    = tonumber(day),
    1.38        hour   = tonumber(hour),
    1.39        minute = tonumber(minute),
    1.40        second = tonumber(second)

Impressum / About Us