function toLDMLString(options) {
  var getOption = getGetOption(options, 'dateformat');

  var ldmlString = '';

  var option = getOption('weekday', 'string', ['narrow', 'short', 'long']);
  ldmlString += appendToLDMLString(
      option, {narrow: 'EEEEE', short: 'EEE', long: 'EEEE'});

  option = getOption('era', 'string', ['narrow', 'short', 'long']);
  ldmlString += appendToLDMLString(
      option, {narrow: 'GGGGG', short: 'GGG', long: 'GGGG'});

  option = getOption('year', 'string', ['2-digit', 'numeric']);
  ldmlString += appendToLDMLString(option, {'2-digit': 'yy', 'numeric': 'y'});

  option = getOption('month', 'string',
                     ['2-digit', 'numeric', 'narrow', 'short', 'long']);
  ldmlString += appendToLDMLString(option, {'2-digit': 'MM', 'numeric': 'M',
          'narrow': 'MMMMM', 'short': 'MMM', 'long': 'MMMM'});

  option = getOption('day', 'string', ['2-digit', 'numeric']);
  ldmlString += appendToLDMLString(
      option, {'2-digit': 'dd', 'numeric': 'd'});

  var hr12 = getOption('hour12', 'boolean');
  option = getOption('hour', 'string', ['2-digit', 'numeric']);
  if (IS_UNDEFINED(hr12)) {
    ldmlString += appendToLDMLString(option, {'2-digit': 'jj', 'numeric': 'j'});
  } else if (hr12 === true) {
    ldmlString += appendToLDMLString(option, {'2-digit': 'hh', 'numeric': 'h'});
  } else {
    ldmlString += appendToLDMLString(option, {'2-digit': 'HH', 'numeric': 'H'});
  }

  option = getOption('minute', 'string', ['2-digit', 'numeric']);
  ldmlString += appendToLDMLString(option, {'2-digit': 'mm', 'numeric': 'm'});

  option = getOption('second', 'string', ['2-digit', 'numeric']);
  ldmlString += appendToLDMLString(option, {'2-digit': 'ss', 'numeric': 's'});

  option = getOption('timeZoneName', 'string', ['short', 'long']);
  ldmlString += appendToLDMLString(option, {short: 'z', long: 'zzzz'});

  return ldmlString;
}
function toLDMLString(options) {
  var getOption = getGetOption(options, 'dateformat');

  var ldmlString = '';

  var option = getOption('weekday', 'string', ['narrow', 'short', 'long']);
  ldmlString += appendToLDMLString(
      option, {narrow: 'EEEEE', short: 'EEE', long: 'EEEE'});

  option = getOption('era', 'string', ['narrow', 'short', 'long']);
  ldmlString += appendToLDMLString(
      option, {narrow: 'GGGGG', short: 'GGG', long: 'GGGG'});

  option = getOption('year', 'string', ['2-digit', 'numeric']);
  ldmlString += appendToLDMLString(option, {'2-digit': 'yy', 'numeric': 'y'});

  option = getOption('month', 'string',
                     ['2-digit', 'numeric', 'narrow', 'short', 'long']);
  ldmlString += appendToLDMLString(option, {'2-digit': 'MM', 'numeric': 'M',
          'narrow': 'MMMMM', 'short': 'MMM', 'long': 'MMMM'});

  option = getOption('day', 'string', ['2-digit', 'numeric']);
  ldmlString += appendToLDMLString(
      option, {'2-digit': 'dd', 'numeric': 'd'});

  var hr12 = getOption('hour12', 'boolean');
  option = getOption('hour', 'string', ['2-digit', 'numeric']);
  if (IS_UNDEFINED(hr12)) {
    ldmlString += appendToLDMLString(option, {'2-digit': 'jj', 'numeric': 'j'});
  } else if (hr12 === true) {
    ldmlString += appendToLDMLString(option, {'2-digit': 'hh', 'numeric': 'h'});
  } else {
    ldmlString += appendToLDMLString(option, {'2-digit': 'HH', 'numeric': 'H'});
  }

  option = getOption('minute', 'string', ['2-digit', 'numeric']);
  ldmlString += appendToLDMLString(option, {'2-digit': 'mm', 'numeric': 'm'});

  option = getOption('second', 'string', ['2-digit', 'numeric']);
  ldmlString += appendToLDMLString(option, {'2-digit': 'ss', 'numeric': 's'});

  option = getOption('timeZoneName', 'string', ['short', 'long']);
  ldmlString += appendToLDMLString(option, {short: 'z', long: 'zzzz'});

  return ldmlString;
}
function toLDMLString ( options ) { var getOption = getGetOption ( options , 'dateformat' ) ; var ldmlString = '' ; var option = getOption ( 'weekday' , 'string' , [ 'narrow' , 'short' , 'long' ] ) ; ldmlString += appendToLDMLString ( option , { narrow : 'EEEEE' , short : 'EEE' , long : 'EEEE' } ) ; option = getOption ( 'era' , 'string' , [ 'narrow' , 'short' , 'long' ] ) ; ldmlString += appendToLDMLString ( option , { narrow : 'GGGGG' , short : 'GGG' , long : 'GGGG' } ) ; option = getOption ( 'year' , 'string' , [ '2-digit' , 'numeric' ] ) ; ldmlString += appendToLDMLString ( option , { '2-digit' : 'yy' , 'numeric' : 'y' } ) ; option = getOption ( 'month' , 'string' , [ '2-digit' , 'numeric' , 'narrow' , 'short' , 'long' ] ) ; ldmlString += appendToLDMLString ( option , { '2-digit' : 'MM' , 'numeric' : 'M' , 'narrow' : 'MMMMM' , 'short' : 'MMM' , 'long' : 'MMMM' } ) ; option = getOption ( 'day' , 'string' , [ '2-digit' , 'numeric' ] ) ; ldmlString += appendToLDMLString ( option , { '2-digit' : 'dd' , 'numeric' : 'd' } ) ; var hr12 = getOption ( 'hour12' , 'boolean' ) ; option = getOption ( 'hour' , 'string' , [ '2-digit' , 'numeric' ] ) ; if ( IS_UNDEFINED ( hr12 ) ) { ldmlString += appendToLDMLString ( option , { '2-digit' : 'jj' , 'numeric' : 'j' } ) ; } else if ( hr12 === true ) { ldmlString += appendToLDMLString ( option , { '2-digit' : 'hh' , 'numeric' : 'h' } ) ; } else { ldmlString += appendToLDMLString ( option , { '2-digit' : 'HH' , 'numeric' : 'H' } ) ; } option = getOption ( 'minute' , 'string' , [ '2-digit' , 'numeric' ] ) ; ldmlString += appendToLDMLString ( option , { '2-digit' : 'mm' , 'numeric' : 'm' } ) ; option = getOption ( 'second' , 'string' , [ '2-digit' , 'numeric' ] ) ; ldmlString += appendToLDMLString ( option , { '2-digit' : 'ss' , 'numeric' : 's' } ) ; option = getOption ( 'timeZoneName' , 'string' , [ 'short' , 'long' ] ) ; ldmlString += appendToLDMLString ( option , { short : 'z' , long : 'zzzz' } ) ; return ldmlString ; }
Returns a string that matches LDML representation of the options object.
Returns a string that matches LDML representation of the options object .