function createFieldText(field_name, slide_num, useDate) {
    var curDateTime = useDate ? new Date(useDate) : new Date()
    var dayInWeek = [
      'Sunday',
      'Monday',
      'Tuesday',
      'Wednesday',
      'Thursday',
      'Friday',
      'Saturday'
    ]
    var monthsList = [
      'January',
      'February',
      'March',
      'April',
      'May',
      'June',
      'July',
      'August',
      'September',
      'October',
      'November',
      'December'
    ]
    var monthsShortList = [
      'Jan',
      'Feb',
      'Mar',
      'Apr',
      'May',
      'Jun',
      'Jul',
      'Aug',
      'Sep',
      'Oct',
      'Nov',
      'Dec'
    ]
    var outValue = ''

    // curDateTime.getDate ()   Returns the day of the month (from 1-31)
    // curDateTime.getDay ()   Returns the day of the week (from 0-6)
    // curDateTime.getFullYear ()   Returns the year (four digits)
    // curDateTime.getHours ()   Returns the hour (from 0-23)
    // curDateTime.getMinutes ()   Returns the minutes (from 0-59)
    // curDateTime.getMonth ()   Returns the month (from 0-11)
    // curDateTime.getSeconds ()   Returns the seconds (from 0-59)

    switch (field_name) {
      // presentation slide number:
      case 'SLIDE_NUM':
      case 'slidenum':
        outValue += slide_num
        break

      // default date time format for the rendering application:
      case 'DATE_TIME':
      case 'datetime':
        outValue +=
          curDateTime.getMonth() +
          1 +
          '/' +
          curDateTime.getDate() +
          '/' +
          curDateTime.getFullYear()
        break

      // MM/DD/YYYY date time format (Example: 10/12/2007):
      case 'DATE_MM_DD_YYYY':
      case 'datetime1':
        outValue +=
          curDateTime.getMonth() +
          1 +
          '/' +
          curDateTime.getDate() +
          '/' +
          curDateTime.getFullYear()
        break

      // Day, Month DD, YYYY date time format (Example: Friday, October 12, 2007):
      case 'DATE_WD_MN_DD_YYYY':
      case 'datetime2':
        outValue +=
          dayInWeek[curDateTime.getDay()] +
          ', ' +
          monthsList[curDateTime.getMonth()] +
          ' ' +
          curDateTime.getDate() +
          ', ' +
          curDateTime.getFullYear()
        break

      // DD Month YYYY date time format (Example: 12 October 2007):
      case 'DATE_DD_MN_YYYY':
      case 'datetime3':
        outValue +=
          curDateTime.getDate() +
          ' ' +
          monthsList[curDateTime.getMonth()] +
          ' ' +
          curDateTime.getFullYear()
        break

      // Month DD, YYYY date time format (Example: October 12, 2007):
      case 'DATE_MN_DD_YYYY':
      case 'datetime4':
        outValue +=
          monthsList[curDateTime.getMonth()] +
          ' ' +
          curDateTime.getDate() +
          ', ' +
          curDateTime.getFullYear()
        break

      // DD-Mon-YY date time format (Example: 12-Oct-07):
      case 'DATE_DD_SMN_YY':
      case 'datetime5':
        outValue +=
          curDateTime.getDate() +
          '-' +
          monthsShortList[curDateTime.getMonth()] +
          '-' +
          (curDateTime.getFullYear() % 100)
        break

      // Month YY date time format (Example: October 07):
      case 'DATE_MM_YY':
      case 'datetime6':
        outValue +=
          monthsList[curDateTime.getMonth()] +
          ' ' +
          (curDateTime.getFullYear() % 100)
        break

      // Mon-YY date time format (Example: Oct-07):
      case 'DATE_SMN_YY':
      case 'datetime7':
        outValue +=
          monthsShortList[curDateTime.getMonth()] +
          '-' +
          (curDateTime.getFullYear() % 100)
        break

      // MM/DD/YYYY hh:mm AM/PM date time format (Example: 10/12/2007 4:28 PM):
      case 'DATE_TIME_DD_MM_YYYY_HH_MM_PM':
      case 'datetime8':
        outValue +=
          curDateTime.getMonth() +
          '/' +
          curDateTime.getDate() +
          '/' +
          curDateTime.getFullYear()
        outValue +=
          (curDateTime.getHours() % 12) + ':' + curDateTime.getMinutes()
        outValue += curDateTime.getHours() > 11 ? ' PM' : ' AM'
        break

      // MM/DD/YYYY hh:mm:ss AM/PM date time format (Example: 10/12/2007 4:28:34 PM):
      case 'DATE_TIME_DD_MM_YYYY_HH_MM_SC_PM':
      case 'datetime9':
        outValue +=
          curDateTime.getMonth() +
          '/' +
          curDateTime.getDate() +
          '/' +
          curDateTime.getFullYear()
        outValue +=
          (curDateTime.getHours() % 12) +
          ':' +
          curDateTime.getMinutes() +
          ':' +
          curDateTime.getSeconds()
        outValue += curDateTime.getHours() > 11 ? ' PM' : ' AM'
        break

      // hh:mm date time format (Example: 16:28):
      case 'TIME_HH_MM':
      case 'datetime10':
        outValue += curDateTime.getHours() + ':' + curDateTime.getMinutes()
        break

      // hh:mm:ss date time format (Example: 16:28:34):
      case 'TIME_HH_MM_SC':
      case 'datetime11':
        outValue +=
          curDateTime.getHours() +
          ':' +
          curDateTime.getMinutes() +
          ':' +
          curDateTime.getSeconds()
        break

      // hh:mm AM/PM date time format (Example: 4:28 PM):
      case 'TIME_HH_MM_PM':
      case 'datetime12':
        outValue +=
          (curDateTime.getHours() % 12) + ':' + curDateTime.getMinutes()
        outValue += curDateTime.getHours() > 11 ? ' PM' : ' AM'
        break

      // hh:mm:ss: AM/PM date time format (Example: 4:28:34 PM):
      case 'TIME_HH_MM_SC_PM':
      case 'datetime13':
        outValue +=
          (curDateTime.getHours() % 12) +
          ':' +
          curDateTime.getMinutes() +
          ':' +
          curDateTime.getSeconds()
        outValue += curDateTime.getHours() > 11 ? ' PM' : ' AM'
        break

      default:
        return null
    } // End of switch.

    return outValue
  }
Translate field_name into the text real value.

This method creating the text to display for the given field.

@param {string} field_name the name of the field.
@param {number} slide_num current slide number.
@param {Date} useDate Optional date to use instead of the current date.
@return The text string data.