arashm / jdate Goto Github PK
View Code? Open in Web Editor NEWA Jalali to Gregorian converter in Javascript with support of formatting output
License: MIT License
A Jalali to Gregorian converter in Javascript with support of formatting output
License: MIT License
Zero leading is more useful for day formatting, like 13951206 (not 1395126)
hi
is there a specific configuration that i don't know to get true answer?
Salam,
Thanks for the great work.
Something is wrong with leapPersian
. 1403 is leap but the function returns false.
سلام.
ظاهرا ماژول روی مخزن ماژول های ند قرار نگرفته
طبق اطلاعات پکیج همچین دستوری باید وارد بشه
npm install JDate
و روی این آدرس: https://www.npmjs.org/package/JDate
که ظاهرا همچین چیزی وجود نداره یا هنوز ثبت نشده
لطفا رسیدگی کنین.
ممنون.
Any working sample for typescript with systemjs?
The JDate class appears to have issues with calculating leap years and the number of days in a month for non-leap years.
JDate.isLeapYear(1403)
should return false.
JDate.daysInMonth(1403, 12)
should return 30.
JDate.isLeapYear(1403)
returns true.
JDate.daysInMonth(1403, 12)
returns 29.
Hi.
i update to version 1 but the node gave me an error when I use require('jalali-date');
Cannot find module 'jalali-date'
so i have to downgrade to version 0.1.1
please fix it in node-js.
new Date(2017, 1, 1).getMonth() // 1
new Date([2017, 1, 1]).getMonth() // 0
new JDate(1396, 1, 1) // fails
new JDate([1396, 1, 1]).getMonth() // 1 ?
new Date(2017, 1, 0) // 31 Jan 2017
new JDate([1396, 5, 1]) // 0 Mordad 1396 ??
hello
in MONTH_NAMES array written 'امرداد' instead of 'مرداد'
Hi,
I need to display the date stored in the Gregorian database in Jalali. How can I do this using your library? My codes are as follows:
elseif($column_type_lookup[$column_name] == 'date'){ //date with format MM/DD/YYYY
if(!empty($row[$column_name]) && ($row[$column_name] != '0000-00-00')){
$form_data[$i][$j] = date('M d, Y',strtotime($row[$column_name]));
}
if($column_name == 'date_created' || $column_name == 'date_updated'){
$form_data[$i][$j] = mf_short_relative_date($row[$column_name]);
}
}elseif($column_type_lookup[$column_name] == 'europe_date'){ //date with format DD/MM/YYYY
if(!empty($row[$column_name]) && ($row[$column_name] != '0000-00-00')){
$form_data[$i][$j] = date('d M Y',strtotime($row[$column_name]));
}
}
سلام!
اگه بشه گزینه های فرمت رو بیشتر بسازید که خیلی عالی میشه!
مثلا فعلا که تنها
Month
Day
Year
رو فرمت میکنه اگه بتونیم
Hour
Minute
Second
Timezone
Offset
رو هم فرمت کنیم اینطوری کارایی بیشتر و کاملتری میتوانیم ازش بگیریم.
یک جهان ممنون از شما!
hi,
do you update this package for angular 2? or how i could use it in angular 2?
thanks
Hi,
In jalali-date/lib/jdate.js:7
you're requiring map
in a try/catch
.
Why you required two modules? Why In a try/catch
?
And why didn't you add map
and map-component
in dependencies
/devDependencies
in package.json
? (The bundling fails using browserify)
Best
Add ability to validate dates.
Hi , thanks for great work.
In convert toGregorian
function it is better to have parseInt
on parameters.
jdate.toGregorian("1393","12","11").getTime(); // NaN
but :
jdate.toGregorian(1393,12,11).getTime(); // 1425241800000
Conver the Jalali to Gregorian when i write this code:
let JDate = require('jalali-date');
let temp = new JDate(1399, 11, 22);
It is behind, One day!
let JDate = require('jalali-date');
let temp = new JDate(1399, 11, 22);
console.log(temp._d); // 2021-02-09T20:30:00.000Z
console.log(new Date); //2021-02-10T07:46:28.132Z
Hi,
How can use this module in Node.js?
when include this module in Node, get this error message:
Cannot find module 'jdate'
Is there any function to convert date string like : 2016-07-13T12:01:12.440Z which fetched from postgresQL to Jalali date? or i should write in my way?
سلام.
ماژول که تو کامیت قبلی اضاف کردم و ماژول که کلا از اول توی اسکریپت گذاشتید اصلا توی مخزن ماژول های ند نیست و جاش یه ماژول دیگه س که کلا کارش یچیزه دیگه هستش در نتیجه موقع استفاده در ند اررور میده 😐
map
خیلی راحته البته جایگزین کردنش، یعنی حتی لازم نیست ازش استفاده کنین وقتی جاوااسکریپت خودش میتونه این کارو بکنه
Array.prototype.map()
var arr = ['1', '2', '3'];
arr = arr.map(function (n) {
return parseInt(n);
});
// [1, 2, 3]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.