Code Monkey home page Code Monkey logo

Comments (5)

fnando avatar fnando commented on July 30, 2024

Could you paste the short format that you're trying to render?

from i18n-js.

bublik avatar bublik commented on July 30, 2024

does not work to on google chrom

var date = new Date();
I18n.strftime(date, "%d/%m/%Y");

"Wed Feb 08 2012 16:17:33 GMT+0200 (EET)"

from i18n-js.

fnando avatar fnando commented on July 30, 2024

Are you populating the I18n.translations object? This is a requirement, so it can retrieve the proper name for months and weekdays. Try running something like this:

I18n.translations = {
  en: {
    date: {
      abbr_day_names: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
      day_names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
      abbr_month_names: [null, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
      month_names: [null, "January", "February", "March", "May", "June", "July", "August", "September", "October", "November", "December"]
    }
  }
};

var date = new Date();
console.log(I18n.strftime(date, "%d/%m/%Y"));
console.log(I18n.strftime(date, "%b %d %Y"));

from i18n-js.

fnando avatar fnando commented on July 30, 2024

No further comments, so I supposed you just figured it out! ;)

from i18n-js.

timvanderweijde avatar timvanderweijde commented on July 30, 2024

I have the same issue. I wonder, are there any template translation files for different languages?

from i18n-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.