src/third_party/v8-3.25/src/i18n.js
/**
 * Returns object that matches LDML representation of the date.
 */
Returns object that matches LDML representation of the date.
Returns object that matches LDML representation of the date .
function fromLDMLString(ldmlString) {
  ldmlString = ldmlString.replace(GetQuotedStringRE(), '');
  var options = {};
  var match = ldmlString.match(/E{3,5}/g);
  options = appendToDateTimeObject(
      options, 'weekday', match, {EEEEE: 'narrow', EEE: 'short', EEEE: 'long'});
  match = ldmlString.match(/G{3,5}/g);
  options = appendToDateTimeObject(
      options, 'era', match, {GGGGG: 'narrow', GGG: 'short', GGGG: 'long'});
  match = ldmlString.match(/y{1,2}/g);
  options = appendToDateTimeObject(
      options, 'year', match, {y: 'numeric', yy: '2-digit'});
  match = ldmlString.match(/M{1,5}/g);
  options = appendToDateTimeObject(options, 'month', match, {MM: '2-digit',
      M: 'numeric', MMMMM: 'narrow', MMM: 'short', MMMM: 'long'});
  match = ldmlString.match(/L{1,5}/g);
  options = appendToDateTimeObject(options, 'month', match, {LL: '2-digit',
      L: 'numeric', LLLLL: 'narrow', LLL: 'short', LLLL: 'long'});
  match = ldmlString.match(/d{1,2}/g);
  options = appendToDateTimeObject(
      options, 'day', match, {d: 'numeric', dd: '2-digit'});
  match = ldmlString.match(/h{1,2}/g);
  if (match !== null) {
    options['hour12'] = true;
  }
  options = appendToDateTimeObject(
      options, 'hour', match, {h: 'numeric', hh: '2-digit'});
  match = ldmlString.match(/H{1,2}/g);
  if (match !== null) {
    options['hour12'] = false;
  }
  options = appendToDateTimeObject(
      options, 'hour', match, {H: 'numeric', HH: '2-digit'});
  match = ldmlString.match(/m{1,2}/g);
  options = appendToDateTimeObject(
      options, 'minute', match, {m: 'numeric', mm: '2-digit'});
  match = ldmlString.match(/s{1,2}/g);
  options = appendToDateTimeObject(
      options, 'second', match, {s: 'numeric', ss: '2-digit'});
  match = ldmlString.match(/z|zzzz/g);
  options = appendToDateTimeObject(
      options, 'timeZoneName', match, {z: 'short', zzzz: 'long'});
  return options;
}
function fromLDMLString ( ldmlString ) { ldmlString = ldmlString . replace ( GetQuotedStringRE ( ) , '' ) ; var options = { } ; var match = ldmlString . match ( / E{3,5} / g ) ; options = appendToDateTimeObject ( options , 'weekday' , match , { EEEEE : 'narrow' , EEE : 'short' , EEEE : 'long' } ) ; match = ldmlString . match ( / G{3,5} / g ) ; options = appendToDateTimeObject ( options , 'era' , match , { GGGGG : 'narrow' , GGG : 'short' , GGGG : 'long' } ) ; match = ldmlString . match ( / y{1,2} / g ) ; options = appendToDateTimeObject ( options , 'year' , match , { y : 'numeric' , yy : '2-digit' } ) ; match = ldmlString . match ( / M{1,5} / g ) ; options = appendToDateTimeObject ( options , 'month' , match , { MM : '2-digit' , M : 'numeric' , MMMMM : 'narrow' , MMM : 'short' , MMMM : 'long' } ) ; match = ldmlString . match ( / L{1,5} / g ) ; options = appendToDateTimeObject ( options , 'month' , match , { LL : '2-digit' , L : 'numeric' , LLLLL : 'narrow' , LLL : 'short' , LLLL : 'long' } ) ; match = ldmlString . match ( / d{1,2} / g ) ; options = appendToDateTimeObject ( options , 'day' , match , { d : 'numeric' , dd : '2-digit' } ) ; match = ldmlString . match ( / h{1,2} / g ) ; if ( match !== null ) { options [ 'hour12' ] = true ; } options = appendToDateTimeObject ( options , 'hour' , match , { h : 'numeric' , hh : '2-digit' } ) ; match = ldmlString . match ( / H{1,2} / g ) ; if ( match !== null ) { options [ 'hour12' ] = false ; } options = appendToDateTimeObject ( options , 'hour' , match , { H : 'numeric' , HH : '2-digit' } ) ; match = ldmlString . match ( / m{1,2} / g ) ; options = appendToDateTimeObject ( options , 'minute' , match , { m : 'numeric' , mm : '2-digit' } ) ; match = ldmlString . match ( / s{1,2} / g ) ; options = appendToDateTimeObject ( options , 'second' , match , { s : 'numeric' , ss : '2-digit' } ) ; match = ldmlString . match ( / z|zzzz / g ) ; options = appendToDateTimeObject ( options , 'timeZoneName' , match , { z : 'short' , zzzz : 'long' } ) ; return options ; }
Returns object that matches LDML representation of the date.
Returns object that matches LDML representation of the date .
// First remove '' quoted text, so we lose 'Uhr' strings. // Sometimes we get L instead of M for month - standalone name.