diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/README | 21 | ||||
| -rw-r--r-- | lib/date.lua | 55 | 
2 files changed, 73 insertions, 3 deletions
| @@ -1,3 +1,18 @@ -In the process of cleaning up... -shell libs are no longer used, just keeping them for historical reference at this point -lua libs are being worked on. +Brief discription of libs so far. For more info see +http://wiki.alpinelinux.org/w/index.php?title=ACF_Libraries + +date.lua - Date and Time functions +fs.lua - Many file type functions. May need to be renamed +join.lua - Takes a table and given a delimeter makes it into a string +pidof.lua - Process libraries not provided by LPOSIX +split.lua - Take a delimeted string and makes it into a table +date.lua - Date and Time lua functions + +validator.lua - Validate web input for ACF.  +html.lua - Helps with form building in ACF +menubuilder.lua -Helps create the menus on left window in ACF +web_elements.lua - More web functionality for ACF +privsep.lua - Helps with authorization with ACF +session.lua -Helps with Session mangement in ACF + +These are currently being worked on. Also we use Lua Posix for the rest of the functionality. diff --git a/lib/date.lua b/lib/date.lua new file mode 100644 index 0000000..d588ecc --- /dev/null +++ b/lib/date.lua @@ -0,0 +1,55 @@ +--date and time functions  + + +module(..., package.seeall) + +require("posix") + +months ={ {"January","Jan"},   +          {"February", "Feb"},  +          {"March","Mar"},  +          {"April", "Apr"}, +	  {"May","May"}, +	  {"June","Jun"}, +	  {"July","Jul"}, +	  {"August","Aug"}, +	  {"September","Sep"}, +	  {"October","Oct"}, +	  {"November","Nov"}, +	  {"December","Dec"} +	   } +-- i am sure there is a better way to do this than a new table + +revmonths = {["January"] = 1, ["Jan"] = 1,  +	     ["February"] = 2, ["Feb"] = 2, +	     ["March"] = 3, ["Mar"] = 3,  +	     ["April"] = 4, ["Apr"] = 4,  +	     ["May"] = 5, +	     ["June"] = 6, ["Jun"] = 6, +	     ["July"] = 7, ["Jul"] = 7, +	     ["August"] = 8, ["Aug"] = 8, +	     ["September"] = 9, ["Sep"] = 9, +	     ["October"] = 10, ["Oct"] = 10, +	     ["November"] = 11, ["Nov"] = 11, +	     ["December"] = 12, ["Dec"] = 12  +	     } +	     	 +--give a search number and return the month name + +function num_month_name (search) +	return months[search][1] +end + +--give a search number and return the month abr + +function num_month_name_abr (search) +	return months[search][2] +end + +function name_month_num (search) +	return revmonths[search] +end + +function abr_month_num (search) +	return revmonths[search] +end | 
