summaryrefslogtreecommitdiffhomepage
path: root/libs/luci-lib-httpprotoutils/luasrc/http/date.luadoc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-04-18 15:49:26 +0200
committerJo-Philipp Wich <jo@mein.io>2018-04-18 16:21:27 +0200
commitb4040aacb04ce38b7eae315d37b2a61a38aea4b1 (patch)
treee8b38cd68d04f5a2bcac5d55294cd591558e349a /libs/luci-lib-httpprotoutils/luasrc/http/date.luadoc
parenteb4571c6dc7e9f99133de1d7df23024ba6d31d9e (diff)
libs: move http.protocol.{date,mime,conditionals} to luci-lib-httpprotoutils
Also adjust the dependencies of components depending on these classes and flatten the namespace from luci.http.protocol.* to luci.http.* Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'libs/luci-lib-httpprotoutils/luasrc/http/date.luadoc')
-rw-r--r--libs/luci-lib-httpprotoutils/luasrc/http/date.luadoc46
1 files changed, 46 insertions, 0 deletions
diff --git a/libs/luci-lib-httpprotoutils/luasrc/http/date.luadoc b/libs/luci-lib-httpprotoutils/luasrc/http/date.luadoc
new file mode 100644
index 0000000000..6028fb4837
--- /dev/null
+++ b/libs/luci-lib-httpprotoutils/luasrc/http/date.luadoc
@@ -0,0 +1,46 @@
+---[[
+LuCI http protocol implementation - date helper class.
+
+This class contains functions to parse, compare and format http dates.
+]]
+module "luci.http.date"
+
+---[[
+Return the time offset in seconds between the UTC and given time zone.
+
+@class function
+@name tz_offset
+@param tz Symbolic or numeric timezone specifier
+@return Time offset to UTC in seconds
+]]
+
+---[[
+Parse given HTTP date string and convert it to unix epoch time.
+
+@class function
+@name to_unix
+@param data String containing the date
+@return Unix epoch time
+]]
+
+---[[
+Convert the given unix epoch time to valid HTTP date string.
+
+@class function
+@name to_http
+@param time Unix epoch time
+@return String containing the formatted date
+]]
+
+---[[
+Compare two dates which can either be unix epoch times or HTTP date strings.
+
+@class function
+@name compare
+@param d1 The first date or epoch time to compare
+@param d2 The first date or epoch time to compare
+@return -1 - if d1 is lower then d2
+@return 0 - if both dates are equal
+@return 1 - if d1 is higher then d2
+]]
+