2017-06-06 28 views

回答

1

,你可以:

i18next.init({ 
    interpolation: { 
     format: function(value, format, lng) { 
      if (format === 'intlDate') return new Intl.DateTimeFormat().format(value); // -> "12/20/2012" if run in en-US locale with time zone America/Los_Angeles 
      return value; 
     } 
    } 
}); 

JSON:key: today is the {{now, intlDate}}

電話T:i18next.t('key', { now: new Date() })