mds92 / md.bootstrappersiandatetimepicker Goto Github PK
View Code? Open in Web Editor NEWBootstrap Persian/Gregorian Date Time Picker
Bootstrap Persian/Gregorian Date Time Picker
با سلام و تشکر
خیلی خوب میشد اگه یه متدی وجود داشت که تاریخ انتخاب شده در حال حاظر به صورت تاریخ جاوا اسکریپت یا همون
DateTime
برگردانده میشد اینطوری دیگه نیازی به پارس کردن هم نبود
و حتی بعد میشه در زمان صدا زدن
val
مثل کامپوننت
InputMask
زمان اصلی رو برگردوند اینطوری حتی در زمان فرستادن فرم و سریالایز کردنش هم بدن نیاز به هیچ عملیاتی به تاریخ صحیح تبدیل شده و به سمت سرور میرفت و دیگه نیازی نبود داخل سرور رشته گرفته بشه و دوباره پارس بشه.
مرسی از این کار خیلی خوب 👍
In Georgian calendar, when the calendar is displayed, I can see the current time when I want to select a datetime, but in Persian, the default time is set to 00:00:00
, but I want to be the current time.
Can you help me regarding this issue?
Hi again,
And again thanks for this awesome plugin, I have one feature request which could be amassing to have.
I'm asking for date range select support like bootstrap daterangepicker, it allows you to select between date range which is somehow like your plugin instead of two textbox, it uses only one with buttons to select the range (eg. last 30 days).
Implementing this would really great and support many things we need!
Thanks again for this great work. 👍
سلام ، ممنون از کد بسیار خوبی که در اختیار قرار دادین،
می خوام تاریخ برای نمایش و انتخاب به کاربر شمسی باشه اما زمانی که می خوام تاریخ به دیتا بیس بفرستم
میلادی باشه در کد های شما فانکشنی برای کانورت به میلادی دیدم چطور ازش استفاده کنم ؟
var hello = var hello = toGregorian(yy, mm, dd);
alert(hello.gy.toString() + " " + hello.gm.toString() + " " + hello.gd.toString());
همیشه مقدار متغییرهای رشته ای بعد از تبدیل به اینت با دستور پارس اینت ، نن می باشد و تبدیلی صورت نمیگیره
سلام
هنگام بیلد خطای زیر رو میده:
Error 1 The name 'RouteConfig' does not exist in the current context D:\Sync\Work\GitHubRepo\MD.BootstrapPersianDateTimePicker\MD.BootstrapPersianDateTimePicker\Global.asax.cs 14 13 MD.BootstrapPersianDateTimePicker
hi
how can i set date format like 1395.10.3. and is there an option to multiselect date from different months?
Hi,
Thanks again for this awesome plugin, if it's not such a big ask and ofcourse this doesn't get conflicts with your codes and all, would you please add this function to your plugin? it's about returning true datetime string using it's format, like in C#, right now all I have added to your plugin was this (this is ugly as I have my own way of writing javascript :D this also needs the plugin to already intialized!):
added this into method variable inside your function =>
getDateTimeByString: function (options) {
var $this = $(this),
settings = $this.data(mdPluginName),
$target = $(settings.TargetSelector),
$format = (typeof options == "string" ? options : (options ? options.format : 0)),
$isEnglishNumber = (options ? options.isEnglishNumber : 0) ? true : false;
if ($target.length <= 0) throw 'TargetSelector is wrong, no elements found';
return getDateTimeString1($target, $format || 'yyyy/MM/dd HH:mm:ss', $isEnglishNumber, false);
},
and this inside your function =>
function getDateTimeString1($target, format, isEnglishNumber, isGregorian) {
var dateTimeInJsonFormat = {};
var selectedDateTimeValue = $target.attr(mdSelectedDateTimeAttributeName);
if (selectedDateTimeValue != undefined && selectedDateTimeValue.trim() != '') {
try {
dateTimeInJsonFormat = JSON.parse(selectedDateTimeValue);
} catch (e) {
dateTimeInJsonFormat = parsePersianDateTime(getTargetValue($target));
}
}
else
dateTimeInJsonFormat = parsePersianDateTime(getTargetValue($target));
var fixedDate = fixPersianDate(dateTimeInJsonFormat.Year, dateTimeInJsonFormat.Month, dateTimeInJsonFormat.Day),
currentDateNumber = convertToNumber(fixedDate.Year, fixedDate.Month, fixedDate.Day);
dateTimeInJsonFormat.Year = fixedDate.Year;
dateTimeInJsonFormat.Month = fixedDate.Month;
dateTimeInJsonFormat.Day = fixedDate.Day;
return getDateTimeString(dateTimeInJsonFormat, format, isEnglishNumber, isGregorian)
}
Usage =>
$('#SampleDateTime').MdPersianDateTimePicker('getDateTimeByString') //returns "۱۳۹۵/۰۸/۲۰ ۱۳:۱۲:۳۸"
$('#SampleDateTime').MdPersianDateTimePicker('getDateTimeByString','yyyyMMddHHmmss') //returns "۱۳۹۵۰۸۲۰۱۳۱۲۳۸"
$('#SampleDateTime').MdPersianDateTimePicker('getDateTimeByString',{format:'yyyyMMddHHmmss',isEnglishNumber:true}) //returns "13950820131238"
Hope you add this 👍
Thanks for this great job :)
با عرض سلام و خسته نباشید بابت ارائه این ابزار مفید
زمانیکه از Bootstrap-rtl جهت راست چین کردن صفحه استفاده میکنم، DatePicker در جای مناسب (با توجه به المان مربوطه) قرار نمیگیره.
از این نسخه استفاده میکنم:
https://www.nuget.org/packages/bootstrap-rtl/3.3.6
اگر راهنمایی بفرمایید ممنون میشم
It would be nice if you make this library available for bower installation. if you want i can help you do that.
با سلام دوباره
این پلاگین اگه بشه دوباره با فراخانی جاوا اسکریپت دوباره ست بشه و تغییر حالت بده خیلی کمک میکنه
و از همه مهمتر باید راحی وجود داشته باشه که پلاگین ست شده روی المنتی رو بشه آنست کرد و دیگه کار نکنه. این قابلیت در قسمت های خاصی که ما میخوایم المنتی رو غیب یا غیر فعال کنیم خیلی به درد میخوره.
مرسی از توجه شما
این مشکل در دموی سوم ، و وقتی در تاریخ میلادی "از تاریخ" رو انتخاب می کنید و چند بار مقدار "تا تاریخ" رو تغییر میدهید ، هنگ میکنه
با تشکر
سلام ، چطور میتونم موقع انتخاب تاریخ فقط ماه و سال در منو باز شده نمایش داده بشه و روز ها مخفی بماند
مثلا من میخوام کاربر فقط بتونه برای گزارش گیری بزنه از ماه مهر 1395 تا آبان 1395
hi..
i use it in my project with angular 2 and using webpack for publish and i faced to this error :
Error: Uncaught (in promise): Error: Error in :0:0 caused by: toJalaali is not defined
ReferenceError: toJalaali is not defined
at getTodayCalendarInPersian (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:4102:21)
at parsePersianDateTime (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:4490:27)
at HTMLInputElement. (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:5485:41)
at Function.each (http://localhost:3000/dist/vendor4.fe78e1c59da123fedf2a.bundle.js:377:19)
at webpackJsonp.774.a.fn.init.each (http://localhost:3000/dist/vendor4.fe78e1c59da123fedf2a.bundle.js:172:17)
at webpackJsonp.774.a.fn.init.init (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:5456:19)
at webpackJsonp.774.a.fn.init.webpackJsonp.1761.$.fn.MdPersianDateTimePicker (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:5574:27)
at LoginLogComponent.webpackJsonp.1436.LoginLogComponent.ngOnInit (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:1747:30)
at Wrapper_LoginLogComponent.ngDoCheck (/SecurityModule/LoginLogComponent/wrapper.ngfactory.js:24:53)
at CompiledTemplate.proxyViewClass.View_LoginLogComponent_Host0.detectChangesInternal (/SecurityModule/LoginLogComponent/host.ngfactory.js:28:31)
at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:60119:14)
at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:60314:44)
at ViewRef_.detectChanges (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:42788:20)
at RouterOutlet.activate (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:55682:42)
at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:20426:16)
at getTodayCalendarInPersian (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:4102:21)
at parsePersianDateTime (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:4490:27)
at HTMLInputElement. (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:5485:41)
at Function.each (http://localhost:3000/dist/vendor4.fe78e1c59da123fedf2a.bundle.js:377:19)
at webpackJsonp.774.a.fn.init.each (http://localhost:3000/dist/vendor4.fe78e1c59da123fedf2a.bundle.js:172:17)
at webpackJsonp.774.a.fn.init.init (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:5456:19)
at webpackJsonp.774.a.fn.init.webpackJsonp.1761.$.fn.MdPersianDateTimePicker (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:5574:27)
at LoginLogComponent.webpackJsonp.1436.LoginLogComponent.ngOnInit (http://localhost:3000/dist/3.fe78e1c59da123fedf2a.chunk.js:1747:30)
at Wrapper_LoginLogComponent.ngDoCheck (/SecurityModule/LoginLogComponent/wrapper.ngfactory.js:24:53)
at CompiledTemplate.proxyViewClass.View_LoginLogComponent_Host0.detectChangesInternal (/SecurityModule/LoginLogComponent/host.ngfactory.js:28:31)
at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:60119:14)
at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:60314:44)
at ViewRef_.detectChanges (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:42788:20)
at RouterOutlet.activate (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:55682:42)
at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:20426:16)
at resolvePromise (http://localhost:3000/dist/polyfills.fe78e1c59da123fedf2a.bundle.js:9539:31) [angular]
at resolvePromise (http://localhost:3000/dist/polyfills.fe78e1c59da123fedf2a.bundle.js:9524:17) [angular]
at http://localhost:3000/dist/polyfills.fe78e1c59da123fedf2a.bundle.js:9573:17 [angular]
at Object.onInvokeTask (http://localhost:3000/dist/vendor1.fe78e1c59da123fedf2a.bundle.js:22553:37) [angular]
at ZoneDelegate.invokeTask (http://localhost:3000/dist/polyfills.fe78e1c59da123fedf2a.bundle.js:9327:40) [angular]
at Zone.runTask (http://localhost:3000/dist/polyfills.fe78e1c59da123fedf2a.bundle.js:9204:47) [ => angular]
at drainMicroTaskQueue (http://localhost:3000/dist/polyfills.fe78e1c59da123fedf2a.bundle.js:9471:35) []
at []
how could i resolve it ?
thanks for any help
با سلام
من از تقویم به صورت زیر استفاده میکنم ولی تقویم روی خود اامنت باز نمیشه و چسبیده به سمت راست صفحه باز میشه:
@using BodySpace.Resources
@model BodySpace.Models.ArticleViewModel
@section styles{
<link href="~/Content/MdBootstrapPersianDateTimePicker/jquery.Bootstrap-PersianDateTimePicker.min.css" rel="stylesheet" />
}
@using (Html.BeginForm("Create", "Articles", FormMethod.Post, new { @class = "form-horizontal", role = "form", enctype = "multipart/form-data" }))
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>@Resource.Article</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.PublishedOn, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.PublishedOn, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.PublishedOn, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Body, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Body, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Body, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="@Resource.Create" class="btn btn-default" />
</div>
</div>
</div>
}
@Scripts.Render("~/bundles/jqueryval")
<script src="~/Scripts/MdBootstrapPersianDateTimePicker/jquery.Bootstrap-PersianDateTimePicker.js"></script>
<script src="~/Scripts/MdBootstrapPersianDateTimePicker/jalaali.js"></script>
<script type="text/javascript">
$('#PublishedOn').MdPersianDateTimePicker({
Placement: 'bottom',
Trigger: 'focus',
EnableTimePicker: true,
TargetSelector: '#PublishedOn',
GroupId: '',
ToDate: false,
FromDate: false,
EnglishNumber: false,
Disabled: false,
});
</script>
hi
is there any option to set default date to dynamic date? for example TODAY?
i saw the demo but it is static ۱۳۹۲/۰۱/۰۱.
i want today to be selected on a INPUT when page loads.
like this :
http://www.jqueryscript.net/demo/jQuery-Datepicker-Plugin-For-Persian-Date-persianDatepicker/
with prior thanks
jquery.Bootstrap-PersianDateTimePicker.js:715
Uncaught TypeError: Cannot set property 'Day' of undefined
// تغییر روز
case changeDateTimeEnum.DayChanged:
newDateTimeInJsonFormat.Day = Number(toEnglishNumber($.trim($senderObject.text())));
hidePopover($popoverDescriber);
break;
مشکل از کجا می باشد؟
Hi
please add this project to bower repository
thanks
به نام خدا
با تشکر از تولید بسیار کارا و مفید شما مشکلی که کاربر را خیلی اذیت میکند انتخاب سالهای قدیم است مثلا تاریخ تولد سال 1360 را اگر بخواهیم انتخاب کنیم چون پنج سال پنج سال به عقب برمیگردد باید شش بار روی آن کلیک کنیم تا به آن سال برسیم. خیلی خوب است که اینترفیس انتخاب سال را تغییر دهیدد تا بتوان با اسکرول سالهای قدیمی را نیز براحتی انتخاب کرد. زیرا در حال حاضر استفاده از این پلاگین برای انتخاب سالهای قدیمی بسیار دردسر ساز است و کاربر راحتتر است که خودش تایپ کند.
البته من با اجازه شما کمی در کدهای شما دست بردم و این مشکل رو برای خودم حل کردم که بازه های 100 تایی سال را می آورد به جای 10 تایی که اکنون در دستر هست.
بازم تشکر می کنم از شما و این رو به عنوان یک پیشنهاد اینجا مطرح می کنم. که با کمی تغییر خیلی کاربری آسانتری خواهد داشت.
حیف این پلاگین زیبا و کاربردی شماست.
قطعه کدی که من تغییر دادم:
// افزودن دراپ داون سال
var $yearDropDown = $calendarHeader.find('[aria-labelledby="dropdownMenuPersianYear"]');
$yearDropDown.html('');
var yearForDropDown = dateTimeInJsonFormat == undefined ? currentYearNumber : dateTimeInJsonFormat.Year;
if (yearForDropDown <= 50)
yearForDropDown = 51;
for (var k = yearForDropDown - 50; k <= yearForDropDown + 50; k++) {
var $dropDownYear = $('<li role="presentation" data-year="' + k + '"><a role="menuitem" tabindex="-1" href="javascript:void(0);" data-name="Md-PersianDateTimePicker-YearNumber">' + toPersianNumber(k) + '</a></li>');
if (k == currentYearNumber)
$dropDownYear.addClass('bg-info');
$yearDropDown.append($dropDownYear);
}
بعلاوه css های زیر:
.dropdown-menu {
height:200px;
overflow:auto;
}
با عرض سلام و تشکر بابت ارائه این تقویم
در زمان اجرا برنامه ارور زیر رو میده
Unhandled exception at line 701, column 17 in http://localhost:16932/Scripts/MdBootstrapPersianDateTimePicker/jquery.Bootstrap-PersianDateTimePicker.js
0x800a138f - JavaScript runtime error: Unable to set property 'Day' of undefined or null reference
ممنون
سلام من میخوام فرمت به صورت زیر باشه
Format: 'yyyy-MM-dd',
چطوری میتونم این کارو انجام بدم
ممنون
با سلام به شما و تشکر بابت کار خوبتون
من از کامپوننت شما در برنامه ام جهت دریافت تاریخ بصورت رشته شمسی و تغییر اون در سمت سرور به کمک کامپوننت دیگر شما و ذخیره در بانک بصورت نوع تاریخ استفاده میکنم.
مشکلی که وجود داره اینه که کاربر گاهی اوقات نیاز دار تاریخ را در انتخابگر تاریخ بصورت میلادی انتخاب نماید اما رشته نمایش داده شده در ادیتور بصورت شمسی باشد.
در صورت true کردن IsGregorian خروجی تقویم در ادیتور بصورت میلادی خواهد بود نه شمسی و علاوه بر اینکه نیاز کاربر برآورده نمیشود، در سمت سرور هم برای تبدیل با مشکل روبرو خواهم شد.
آیا امکانش هست تقویم هم بصورت میلادی و هم شمسی صرفاً خروجی رشته شمسی داشته باشه؟
ممنون
Hi
thanks for your great project, my bro
please add a button to switch between Jalali to Gregorian and vice versa.
if this feature is, please add sample to show this feature.
hello dear @Mds92 i use your date picker in my projects
من چطوری میتونم به جای / از خط تیره - بین روز و ماه و سال استفاده کنم
thank you very much
Please upload it to npm
For example I've selected 01/01/2017 and I change it in the text input to 01/01/2016, then I open the datepicker and it's still in 01/01/2017. I think it should bind to the change of text input.
HI. please add Additional-field and UNIX time-stamp for it. this can help for send and store date very easier in db.
position of datepicker is not okay when use it with bootstrap-rtl
سلام
کنترل خوبی طراحی کردید ضمن تشکر از شما
زمانیکه درون فرم بکار برده شود چنانچه تکست باکس تاریخ فوکوس بگیرد
تقویم نشون داده میشه وقتی یکی از روزهای تاریخ انتخاب میشه تکست باکس تاریخ به روز نمیشه
اگر راهنمایی کنید ممنون میشم
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<div class="form-horizontal">
<div class="form-group">
@Html.LabelFor(m => m.StartDate, new { @class = "control-label", @for = "fromdate" })
<div class="input-group">
<span class="input-group-addon" data-mddatetimepicker="true" data-trigger="click" data-targetselector="#fromdate" data-fromdate="true" data-enabletimepicker="false" data-placement="bottom">
<span class="fa fa-calendar"></span>
</span>
@Html.TextBoxFor(m => m.StartDate, new { @class = "form-control", id = "fromdate", placeholder = "از تاریخ", data_groupId = "group1", data_mddatetimepicker = "true", data_trigger = "focus", data_targetselector = "#fromdate", data_fromdate = "true", data_enabletimepicker = "false", data_placement = "bottom" })
</div>
@Html.ValidationMessageFor(m => m.StartDate, "", new { @class = "text-danger" })
</div>
}
Hi.
How to use DatePicker as inline calendar?
سلام
با تشکر از کنترل زیبا و خوب شما
شاید اینجا جای این سوال نباشه و باید توی فروم ها مطرح بشه
ولی چ جوری توی گراید استفاده میشه بخصوص کندو
ممنون از شما
با سلام اول تشکر بابت زحمتتون
یک مشکل هست و اون این هست که چطور میتونم تاریخ انتخابی به این فرمت 1395/05/23 به خاصیت value انتخابی قرار بدم روی input box و از اونجا در برنامه mvc خودم ارسال کنم به اکشن متد ؟ ممنونم
با سلام
در صورتی که بخوایم به المنت هایی که میخوایم دیت پیکر داشته باشن یک کلاس بدیم و همه اون المنت هایی که اون کلاس رو دارن دیت پیکرو نمایش بدن به صورتی که بعد از انتخاب تاریخ، تاریخ انتخاب شده داخل المنت خودش نمایش داده بشه به چه صورتی باید عمل کرد؟
$('.datePicker').each(function() {
$(this).MdPersianDateTimePicker({
Placement: 'popover',
Trigger: 'click',
EnableTimePicker: false,
TargetSelector: ???????????,
GroupId: '',
ToDate: false,
FromDate: false,
DisableBeforeToday: false,
Disabled: false,
Format: 'yyyy/MM/dd',
IsGregorian: false,
EnglishNumber: true,
});
});
سلام خسته نباشید
می خواستم وقتی که ما تاریخ رو انتخاب میکنیم در تکست باکس به اعداد را فاررسی نمایش میدهد
من می خواهم اعدادی که در تکست باکس قرار گرفتن به صورت لاتین باشند
میشه راهنمایی بفرمایید ؟
سلام
با تشکر از شما
من این دیت پیکر رو استفاده کردم ، فقط تنها مشکلی که داره اینه که وقتی فرمت نمایش تاریخ رو عوض می کنم هیچ تغییری نمی کنه
ممنون میشم راهنمایی کنید
سلام
آیا هم اکنون امکان غیر فعال کردن تاریخ از یک زمان خاص وجود دارد ؟
مثلا قبل از سال 94 ممکن نباشد یا بعد از 94 ممکن باشد
سلام ، ممنون از کد عالی شما و تشکر از تلاشتون، من از تقویم شما در برنامه
asp.nwt mvc
نسخه 5 استفاده کردم و نسخه
bootstrapt و jquery هم به اخرین نسخه ارتقا دادم .
مشکلی در استفاده از کد شما دارم و این که در صورتی که یکی یا بیشتر تقویم در صفحه باشه همیشه تقویم در گوشه سمت راست صفحه باز میشه
حتی اگر چند تا تقویم باشه منو تقویم بعد از کلیک در جای مناسب نشون داده نمیشه
چند عکس از این موضوع ضمیمه کردم .
باتشکر از توجه شما!
When I Create a text box on the fly (With jQuery) Date picker shows , but can not set date value in textbox.
Is it a way to solve this?
نسخه سازگار با Bootstrap v4 کی میاد؟
سلام
وقتی تگ input رو runat server قرار میدم باعث میشه که دیگه مقدار بهش نسبت داده نشه
میتونین راهنمایی کنین؟
please add a trigger to datetimepicker to fire when user click on one day when popover is shown.
thank you. very much.
سلام دوست عزیز
میشه لطفا مورد من رو بررسی کنین که مشکل از کجاست
اسکریپت های مورد نیاز و همچنین سی اس اس هارو ادد کردم
وقتی پیجم بالا میاد ، کنترلر تاریخ دیزیبلد هست. روش کلیک میکنم چیزی باز نمیشه
اتچ کردم عکس رو.
. موقع نمایش کنترلر بجای اینکه اون انتخاب کننده سمت چپ نشون داده بشه ، سمت راست نشون داده میشه.
من از مترونیک استفاده کردم .
امیدوارم بتونین کمکم کنید.
بعد از نمایش باکس انتخاب تاریخ هیچ چیز عمل نمی کنه و این خطا هارو تو کنسول دارم.
هر قدر که روی دکمه ای کلیک میکنم خطاها زیاد تر میشن.
لطفا راه حل ارائه کنید.
@Mds92
`Uncaught TypeError: Cannot set property 'Day' of undefined
at updateDateTimePickerHtml (PersianDateTimePicker.js:1331)
at HTMLTableCellElement. (PersianDateTimePicker.js:1362)
//----------------------------------------------------------------------------
Uncaught TypeError: Cannot read property 'Month' of undefined
at increaseOneMonth (PersianDateTimePicker.js:268)
at updateDateTimePickerHtml (PersianDateTimePicker.js:1289)
at HTMLButtonElement. (PersianDateTimePicker.js:1374)
//----------------------------------------------------------------------------
Uncaught TypeError: Cannot set property 'Year' of undefined
at updateDateTimePickerHtml (PersianDateTimePicker.js:1350)
at HTMLAnchorElement. (PersianDateTimePicker.js:1386)
//----------------------------------------------------------------------------`
Hi
Thanks for your great plugin 👍
I have an inline form for editing grid row, which one of its controls is MdPersianDateTimePicker (target)
there's a situation when user clicks on target and datetimepicker popover pops up, and then user cancels the form (clicks on form cancel button), the popover does not hide.
I think this is happening because of target element does not exists anymore after that inline form has been removed from body, and what i understood from MD.BootstrapPersianDateTimePicker.js source code, the popover will be hidden based on found target
What can I do to fix this issue?
Regards
Mahyar
I want to use this calendar with both Jalali and Gregorian configurations. Is it possible? (preferably with a button to switch between them)
weekday of today in the footer is off by 1 day
I fixed it by changing line 331 from:
todayDateTimeString = 'امروز، ' + getPersianWeekDay(persianTodayDateTemp[2]) + ' ' + toPersianNumber(currentDayNumber) + ' ' + getPersianMonth(currentMonthNumber) + ' ' + toPersianNumber(currentYearNumber),
to
todayDateTimeString = 'امروز، ' + getPersianWeekDay((persianTodayDateTemp[2]+6)%7) + ' ' + toPersianNumber(currentDayNumber) + ' ' + getPersianMonth(currentMonthNumber) + ' ' + toPersianNumber(currentYearNumber),
(persianTodayDateTemp[2]+6)%7 was chosen rather than simply (persianTodayDateTemp[2]-1) to avoid getting a possibly negative function argument on Sunday.
It seems to work for today, haven't yet tested it for other days though.
Alternatively, relying on the JS native i18n API, replacing the entire RHS with 'امروز، ' + (new Date).toLocaleDateString("fa-IR", {weekday: "long", year: "numeric", month: "long", day: "numeric"}).slice(0, -5), will also do the trick and be less of a hack.
Hello,
I copy all of content demo 2 in my page and add js and css , but i have error when click or select date.
Uncaught TypeError: Cannot set property 'Day' of undefined
at updateDateTimePickerHtml (jquery.Bootstrap-PersianDateTimePicker.js:1374)
at HTMLTableCellElement. (jquery.Bootstrap-PersianDateTimePicker.js:1411)
at HTMLDocument.dispatch (jquery-3.1.0.min.js:3)
at HTMLDocument.q.handle (jquery-3.1.0.min.js:3)
woould you give an example of data-fromdate,data-todate
i cant set them .
how can i limit data-todate to current date .
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.