Comments (9)
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.
Read here: http://momentjs.com/docs/#/i18n/changing-locale/ and use "fa-IR".
from moment-jalaali.
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.
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.
You need to add fa locale to your project. Read more there.
from moment-jalaali.
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.
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.
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.
Send me an email. My email is on my profile page.
from moment-jalaali.
Related Issues (20)
- how can I change the months label to Dari/Farsi for Afghanistan? HOT 6
- how to mock moment() in jest?
- wrong time for next year
- 24 hours HOT 1
- How can i use method valueOf after using format function? HOT 1
- [fa locale] moment.months() HOT 1
- Show En digit not Persian Digit HOT 1
- Moment-timezone Dependency HOT 3
- moment.jDaysInMonth bug HOT 1
- Es6 Is not supporet HOT 2
- Three-letter month format HOT 3
- wrong result HOT 1
- wrong persian date HOT 1
- Why weeks start from یکشنبه? HOT 2
- what is require('moment/moment') ?
- Maybe the plugin needs an update HOT 3
- how get start and end current week HOT 5
- add(1, day) returns the same day, on the first day of any year. HOT 3
- suggestion, can we count the jWeek number, starting from the first complete week of the year? HOT 1
- How to compare jalaali persian dates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moment-jalaali.