Smart Buttons
Controls/XML Elements

Date/Time <DateTime>

This control adds dates to your script. This control can allow agents to:

  • Read the current date, or set up specific number of days to subtract or add from the current date.

  • Select the language (for month translation) and time zone associated to the date.

Configuring

You can configure DateTime using either the Date/Time XML Generator or XML.

Configuring with the Date/Time XML Generator

To configure with the Date/Time XML Generator:

  1. Open the Smart Buttons Editor to create a script.

  2. Click Date/Time <DateTime>.

  3. Configure all attributes.

    Attribute

    Description

    Variable name The name of the variable. For example: CurrentDate
    Input date  
    Advanced input date format
    Date/Time format

    Select the date/time format.

    Custom date format

    If the format you want to use is not available in the Date/Time format list, enter different format.

    Date language Select the language for translating the month. For example, to add the current date to an itinerary remark for a Spanish customer, set the Language to Spanish to display the month in Spanish.
    Time zone Select the time zone used to read the data.
    Add/Remove days/time Select the numbers of days (d), hours (h), or minutes (m) to add or subtract from the current date and time. For example, – 2 to set to the current date minus 2 days.
  4. Click Submit.

Configuring with XML

If you do not want to use the Date/Time Editor, you can enter XML code directly in the Smart Buttons Editor.

Tip! You can add the XML code directly to the editor by dragging and dropping the blue button for this control.

This is the structure of the Date/Time XML element.

Copy
<DateTime VarName="" DateTimeFormat="" Language="" AddOrRemoveDays="" TimeZone=""></DateTime>

Attribute

Description

VarName Specify Variable, for example, CurrentDatePlus3Days.
InputDateLanguage  
InputDateFormat  
DateTimeFormat Enter a date/time format. For example, dd/mm/yyyy.
Language

Enter the two-character language code to translate the month in DateTimeFormat.

For example, enter de to translate the month to German.

AddOrRemoveDays

Enter the numbers of days to add or subtract from the current date. For example:

  • – 2 to set to the current date minus two days

  • +5 to set to five days after the current date

TimeZone

Enter the time zone used to read the data.

Examples
Example 1

Add a notepad remark with current date and time.

Copy
<ButtonConf ButtonName="Notepad with Booking Time creation" Description="" QuickCommand="">
<DateTime VarName="CurrentDate" DateTimeFormat="ddMMMyy HH:mm" Language="en" AddOrRemoveDays="0" TimeZone="W. Europe Standard Time"></DateTime>
<RunCommand>NP.Booking Refunded on [CurrentDate] GMT+1 time zone</RunCommand>
</ButtonConf>
Example 2

Display a message to agents to remind them to issue invoices if they are running the script at 16:00 or later.

Copy
<ButtonConf ButtonName="Reminder" Description="" QuickCommand="">
<DateTime VarName="Time" DateTimeFormat="HH" Language="en" AddOrRemoveDays="0" TimeZone="W. Europe Standard Time"></DateTime>
<ConditionalAction Condition="[Time]&gt;=16">
<True>
<ShowMessage>Remember to issue invoices for tickets issued today</ShowMessage>
</True>
</ConditionalAction>
</ButtonConf>
Example 3

Define Variable: CurrentDateinus5Days, which:

  • Holds the current date from the Fiji Standard Time zone

  • Minus 5 days
  • Date format in dd.MM.yyyy and language: da (Danish)

Copy
<DateTime VarName="CurrentDateMinus5Days" DateTimeFormat="dd.MM.yyyy" Language="da" AddOrRemoveDays="-5" TimeZone="Fiji Standard Time"></DateTime>