2011/3/24 Cecil Westerhof <[email protected]>
> \startluacode
> function modification_date(file, format)
> local f = file
> local attr = lfs.attributes(f)
>
> assert (type(attr) == "table")
> if attr.mode ~= "directory" then
> if format == "long" then
> return os.date("%Y-%m-%d %H:%M",attr.modification)
> else
> return os.date("%Y-%m-%d",attr.modification)
> end
> end
> end
> \stopluacode
>
I made the code a little better:
\startluacode
os.setlocale("nl_NL")
function modification_date(file, format)
local f = file
local attr = lfs.attributes(f)
local fmt = "%d %B %Y"
assert (type(attr) == "table")
if attr.mode ~= "directory" then
if format == "long" then
fmt = fmt .. " %H:%M"
end
return os.date(fmt,attr.modification)
end
end
\stopluacode
There is only one problem. I get:
25 March 2011
instead of:
25 maart 2011
What am I doing wrong?
--
Cecil Westerhof
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________