WriteEditionDate tag script (example)

Build 1501 on 14/Nov/2017  This topic last edited on: 7/Nov/2016, at 14:48

The Editions.vb in the TagScripts add-ins project contains the Public class Editions and several functions.

Public Function WriteEditionDate(TitleName As String, EditionDate As String, Filter As String) As String

Calculates and stores in the database the edition date with the format as specified in the Filter parameter, e.g. as dd/mm/yyyy, where dd and mm are zero-padded.

Possible format:

   dns        day as number without leading 0 (day number single)

   dnd        day as number with leading 0 (day number double)

   wdw        day of week name

   mns        month as number without leading 0 (month number single)

   mnd        month as number with leading zero (month number double)

   wmw        month name

   yy                year 2 digits

   yyyy        year 4 digits

   examples: dnd/mnd/yyyy  dnd. wmw yyyy.

Private Function GetWeekDay(Weekday As Integer) As String

Returns the names of days in English language.

Private Function GetMonth(Month As Integer) As String

Returns the names of months in English language.

Important

This will work only on master pages!

Have in mind that the name of the WriteEditionDate function is referenced in the schema addition, therefore, the function name must not be modified or parameters changed without syncing the related schema statements as well.

Should you add more functions, you need to reference them in the schema in the same way the sample WriteEditionDate is referenced.

How to call this function?

See Test new variable.