webmcp
view framework/env/format/timestamp.lua @ 30:6e08067e66c1
allow disabled records in select widget
this allows the use record entries as seperators
this allows the use record entries as seperators
| author | Daniel Poelzleithner <poelzi@poelzi.org> | 
|---|---|
| date | Mon Sep 20 20:11:29 2010 +0200 (2010-09-20) | 
| parents | 9fdfb27f8e67 | 
| children | 08c107cc4fce | 
 line source
     1 --[[--
     2 text =                 -- text with the given timestamp value formatted according to the locale settings
     3 format.timestamp(
     4   value,               -- a timestamp or nil
     5   {
     6     nil_as = nil_text  -- text to be returned for a nil value
     7   }
     8 )
    10 Formats a timestamp according to the locale settings.
    12 --]]--
    14 function format.timestamp(value, options)
    15   if value == nil then
    16     return options.nil_as or ""
    17   end
    18   return format.date(value, options) .. " " .. format.time(value, options)
    19 end
