Giter Club home page Giter Club logo

Comments (9)

behrang avatar behrang commented on July 20, 2024 1

moment-jalaali does not replace numeric digits with their Persian equivalents. If you need that, use moment's localization which has this feature.

But if you want to display month names in Persian, jM in your format string should be changed to jMMMM. This way you will get month name (for example "Mehr"), and if you want to get Persian month name, you can use moment.loadPersian() statement, before using the format in another statement. This way you'll get "مهر".

from moment-jalaali.

behrang avatar behrang commented on July 20, 2024 1

Read here: http://momentjs.com/docs/#/i18n/changing-locale/ and use "fa-IR".

from moment-jalaali.

tomvolek avatar tomvolek commented on July 20, 2024

Thanks Behrang. This is what I have :
if (TAPi18n.getLanguage() == 'en') {
return moment(new Date()).format("dddd, MMMM Do YYYY");
}
else if (TAPi18n.getLanguage() == 'fa') {
moment.loadPersian();
return moment(new Date()).format('jYYYY/jMMM/jD');
}

And this is the output I get : 1394/مهر/26

I know this has nothing to do with your moment-jalaali plugin, but I assume somewhere I need to define the numbers to get translated to . Where would that be ?

Regards

from moment-jalaali.

tomvolek avatar tomvolek commented on July 20, 2024

interesting , the latest moment.js has a local for Persian . https://github.com/moment/moment/blob/develop/locale/fa.js

However statement moment.locale('fa'); doesn't load it as the documentation shows in your above link.
I am wondering If I have to define the moment.local('fa', {.....} ); explicitly in my javascript code.

from moment-jalaali.

behrang avatar behrang commented on July 20, 2024

You need to add fa locale to your project. Read more there.

from moment-jalaali.

tomvolek avatar tomvolek commented on July 20, 2024

I Behrang. You helped me with a moments question few months back. I live in San Francisco ,

Man allan omadam Tehran. Einja meteor developer hast ? Vakht Dari telephoni sohbat koneem ?

Mamnoon mesham

Hamid

Sent from my iPhone

On Oct 19, 2015, at 9:42 AM, Behrang Noruzi Niya [email protected] wrote:

Closed #47.


Reply to this email directly or view it on GitHub.

from moment-jalaali.

behrang avatar behrang commented on July 20, 2024

Yes you can call me.

On Wed, Dec 30, 2015 at 7:13 AM tomvolek [email protected] wrote:

I Behrang. You helped me with a moments question few months back. I live
in San Francisco ,

Man allan omadam Tehran. Einja meteor developer hast ? Vakht Dari
telephoni sohbat koneem ?

Mamnoon mesham

Hamid

Sent from my iPhone

On Oct 19, 2015, at 9:42 AM, Behrang Noruzi Niya <
[email protected]> wrote:

Closed #47.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#47 (comment)
.

from moment-jalaali.

tomvolek avatar tomvolek commented on July 20, 2024

What is your phone number ?

Sent from my iPhone

On Jan 2, 2016, at 3:42 PM, Behrang Noruzi Niya [email protected] wrote:

Yes you can call me.

On Wed, Dec 30, 2015 at 7:13 AM tomvolek [email protected] wrote:

I Behrang. You helped me with a moments question few months back. I live
in San Francisco ,

Man allan omadam Tehran. Einja meteor developer hast ? Vakht Dari
telephoni sohbat koneem ?

Mamnoon mesham

Hamid

Sent from my iPhone

On Oct 19, 2015, at 9:42 AM, Behrang Noruzi Niya <
[email protected]> wrote:

Closed #47.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#47 (comment)
.


Reply to this email directly or view it on GitHub.

from moment-jalaali.

behrang avatar behrang commented on July 20, 2024

Send me an email. My email is on my profile page.

from moment-jalaali.

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.