Topic on Extension talk:Scribunto

Limits of mw.language:formatDate

6
Paweł Ziemian (talkcontribs)

I created a test script in Lua that calculates all available Easter dates. The final output table consists of ~8000 dates. In the next step I tried to format the dates to strip the year and display only day (in arabic notation) and month (in roman notation) but I got error -> "Lua error: Too many calls to mw.language:formatDate()". Why is there any limit? What is the limit? Is any workaround to obey it? Regards.

Anomie (talkcontribs)

The limit is currently 6000 characters total for the format srings in all calls to formatDate() (e.g. 6000 calls with 1-character format strings, or 600 with 10-character format strings, 1 with a 6000-character format string).

The limit was copied from ParserFunctions's #time function.

Paweł Ziemian (talkcontribs)

I divided the whole table into smaller chunks (a hundred years per table), hoping that the limit is per {{#invoke:...}}, but this did not help. The limit is per page, and is ehausted in XVI century :-(. Are there any chances to get rid of the limit in the function code? The LUA scripts are already limited in two dimensions: time of script execution and memory consumption.

Paweł Ziemian (talkcontribs)

I created custom date format routine to avoid the limit and got my expected result in this page. However I don't like the solution.

Reply to "Limits of mw.language:formatDate"