Module:ReferenceCleaner: Revision history

From TwogPedia

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

19 August 2022

  • curprev 21:2221:22, 19 August 2022Couchor talk contribs 778 bytes +778 Created page with "local Class = require('Module:Class') local ReferenceCleaner = {} function ReferenceCleaner.clean(dateWithRef) if dateWithRef == nil then return '' end -- due to '-' and '?' being part of the 'magic' characters for patterns -- we have to escape them with '%' dateWithRef = dateWithRef:gsub('%-%?%?', '-01') dateWithRef = dateWithRef:gsub('%-XX', '-01') local correctDate = string.match(dateWithRef, '(%d+-%d+-%d+)') if correctDate then return correctDate end..."