Code

Discussion on Calentim - Date Time Range Picker

Discussion on Calentim - Date Time Range Picker

By
Cart 482 sales

tpaksu supports this item

Supported

This author's response time can be up to 5 business days.

187 comments found.

Hello – is it possible to disable the leading/trailing dates in a month? so if looking at june-july months, it only shows June dates in June and July in July (rather than the end of may and beginning of July in the June box, etc)

Look at the previous comment.

Hello,

How to hide this: https://take.ms/6iqSa

I only want to show current month and not anything extra.

Thanks.

Add this to your styles

.calentim-not-in-month { display: none; }

This is not correct way, if you do this, the date will no longer match the day, before adding this css calendar was correct now date is 30 and day is monday which is not correct. could you provide correct solution?

ok instead of display:none, set “visibility:hidden” and “pointer-events: none” inside that class.

Hi,

Possible to know the size of JS/CSS of this library ?

Thanks in advance

minified js file is 93kb, minified css file is 93kb. and it’s dependent to moment.js library which is 214kb with all the locales included. Of course there’s also the jQuery library itself. But I suppose you already have that.

Quick question – is there a way to turn off leading zeros in the time picker? 07:30 is fine for 24-hour display, but 07:30pm looks wrong with am/pm.

I think not. But I’ll add when I finish the SCSS thing.

Pushed the new `dontPrefixHours` option.

Are there any plans to create a Dark Mode CSS? I tried editing the variables and compiling the SASS, but the main calendar and a lot of the elements are still coming out on a light background and the CSS seems to have ‘hard-coded’ colours in many places rather than using SASS variables.

I’ll try and let you know.

Pushed the dark mode CSS.

Hi Author, I have integrated the calentim in our project, currently on mobile I am facing an issue, I have auto triggered to open the calendar and auto select the date and used the property to autocloseselect to close the calendar automatically, it works good on the web version previously it was working on the mobile version too, but past one week it is not working on the mobile version.  Please can you assist me to resolve this issue.

URL:http://medicalmalquote.ja.deals/

mobile url:- http://medicalmalquote.ja.deals/api/getIndicativeQuote/eyJpdiI6ImplSGxLRWtCZ2JiaWVza0lzMG9yRnc9PSIsInZhbHVlIjoiY0hcLytZR2dpZ3pkNDBITks5RE5nb0E9PSIsIm1hYyI6Ijk4MGY2ZTdkYTQ0MzNiYTgzM2Y0NjY5NmQ2NmUxNDMyZjVmMDEwNGJjNzBkZGIwMDQ3MDg5N2VlMTI0MzIyNmEifQ==

Please click the url mobile view.

Hello, it works on my android phone. What’s the problem?

i love this control well done. One question, i want to link two dates and have followed your example to do this for Linked Single Date Pickers – but what i want to know is if this could be done with only one instance of the Calentim control. The reason is, if i start to select the date range from the start date input box the calentim instance vanishes then this jumps to the second instance for me to select the end date. Ideally i want just want instance but with two input controls – one for start date and one for end date. Is this possible?

Hello, I didn’t try it before but it should be possible with changing the target on onfirstselect and onafterselect and probably onhide and onshow methods. I’ll try to create an example but don’t expect soon because I’m in middle of a house move now :)

Hi tpaksu – i have had a good play and almost got a working version of this but got a couple of issues that need resolving. The main issue is that the first input box still shows the from and to dates whilst you are in the middle of selecting a range. Ive got it displaying only the start date once the range has been selected which is good news. The other issue is related i think, and that is if mid way through selecting a date range the user presses esc to cancel it – then this leaves the start and end date showing in the first input box. I am almost there but not quite :)

Can you fill the inputs on the ondraw event too? İt’ll fix that issue I guess. And there’s also onhide event which may help.

Hi,

First off, great library.

I originally integrated this in to a website, and it worked perfectly. Now, we are beginning to integrate Vue.js into our application with single file components.

Vue + jquery isn’t always the easiest implementation. 1) Do you know anyone that’s used this library with Vue? 2) Do you have any working examples using Vue? 3) Is there a version of this library in pure javascript?

Thanks, Adam

Hello Adam,

I don’t know any, but it should work without any problem, IMHO. I really don’t know. But it should be easy to implement, just add jQuery and calentim files where you have the and on mounted event, initialize the plugin. you should have access to ”$” inside the “mounted” event.

I am using date time range picker. User select the end time before the start time. How can I limit the user to make such selection?

Hello chwong1, you can set the minDate when the user selects the first date.

onfirstselect: function(instance, start){
    instance.config.minDate = start.clone();
    instance.reDrawCells();
},    
onafterselect: function(instance, start, end){
    instance.config.minDate = null;
    instance.reDrawCells();
}

I initialized calentim on 2020-03-10 13:30:00 with following options: let options = { singleDate: true, calendarCount: 1, minuteSteps: 15, hourFormat: 24, options.inline = true; options.showCalendars = false; };

So it’s a timepicker with minute steps set to 15. After initialization (on user action) I changed dateStart and minuteSteps. like that:

calentim.config.startDate = moment(‘2020-03-10 13:00:00’); calentim.config.minuteSteps = 10; // I also added limitTimeForDay from 13:00 to 14:00 calentim.reDrawCalendars();

see this picture https://tinypic.pl/do20gnzs2b7d minuteSetps is still displayed as 15 and there is no time limit drawn. However when I click on minutes arrow and change something it works correctly: https://tinypic.pl/rbzmwzciq0i4

So how to force this plugin to reDraw everything correctly right after calling reDrawCalendars ?

Sure. Just let me know.

The update got approved now. You can download and test v1.3.6

I’ve checked and behaviour is same as it was. So my post ( https://codecanyon.net/comments/23835455 ) is still actual.

I have got following settings set to calentim

``` let options = { singleDate: true, calendarCount: 1, autoCloseOnSelect: true, minuteSteps: 15, hourFormat: 24, startEmpty: true }; ```

In such way timepicker (selecting hours and minutes) is blocked and user can’t select the time before selecting a date. However selecting a date causes closing the calendar because of autoclose. So to set the date and the time user has to open calendar twice, which isn’t a nice solution. For me timepicker should be enabled and it’s connected input shouldn’t be updated unless user picks a date. It’s probably due to startEmpty set to true, so there is no date selected. I saw that 2 weeks ago @egokalp also had got issue with this settings. For demo just check your own example: “Empty on initialization” and try to change hour before selecting any date.

Do you have got an idea how to fix this, to not open twice a calendar for selecting date and time with following options provided?

Hello sabat24, I couldn’t decide how to select and display a time when the calendar starts empty, because the date and time portion are connected together inside the plugin. There’s no only time selection or only date selection in reality, only the parts shown when disabling specific parts with showCalendars or showTimePickers options. Maybe you can use the inline: true option to display the calendar in a dropdown, then using the onAfterSelect event, you can close the dropdown by code. This seems to be the easiest solution. Also it will give you the chance to use it anyway you want. I probably won’t be here at the weekend, but I’ll check it on Monday.

I was thinking about using temporary “zero” date in such case. So if addTimePickerEvents is fired on empty input it will use internally startDate like “01/01/0000 00:00:00”. Changing one hour will update that internal date to “01/01/0000 01:00:00”. However in such case you shouldn’t update the “real” startDate and calendar view. I tested it in my case and it seemed to work fine. However I finally decided to remove autoCloseOnSelect:true and I added showButtons:true as the simplest and fastest solution for now.

Yes I was thinking about the zero date but I thought that it had a limit on UNIX timestamps because my code uses it extensively. Great if you figured it out.

Hey there, thanks for this fantastic and great value plugin. I’ve just had a client request a very specific feature though. It’s for a restaurant and their problem is, they are getting swamped with bookings between 6:30 and 8:30 and are wondering if I can modify the time picker, to block people from selecting those hours just on Friday and Saturday night.

I’m not the most technically able person on this stuff. Can your plugin achieve this and could I possibly trouble you for an example? I’ve been playing with the limitTimeForDay (); option, but can’t seem to get it to work.

Thanks so much for your support.

All The Best: Dave

Hello Dave, do you have a demo page that you can show? If you have, please contact me from my profile contact form, and if you don’t, you can send me the configuration you are trying to do with limitTimeForDay method via the same form too.

Have a bug in show only time

When i set start/end time 2020/2/28 & change the time They will only show on format of current day 2020/2/25 not 2020/2/28 Please check this

start date not change, only end date change to 28

Yes you are right! There’s a bug when using only date pickers, the fetchInputs method is causing the bug. It modifies the whole date after it parses (line 680-681 on the code). I’ll fix it and send you the updated code, if you can contact me on my profile contact box (I won’t release a new version with that fix yet)

Ok i have send you my email.

Hello, Nice plugin. Thanks. TimePickers does not work (unable to change) when startEmpty is set to true. Is this a bug or am i doing something wrong? Config : showCalendars: false, autoCloseOnSelect: false, startOnMonday: true, locale: LNG, singleDate: false, showHeader: false, showFooter: false, showButtons: true, showTimePickers: true, hourFormat: 24, startEmpty: true, format: ‘hh:mm’

Hello do you have a demo page?

how to disable arrow on time?

What do you mean? You can hide it with CSS, there’s no setting to hide it.

Hey,

I am using your date range plugin called calentim. I am having an issue on click of the apply button. I need an event to pass the selected time on click of the apply button to an API. Hope you can help m out with this

Thanks, Rubin Pramod

1. No, it’s not supported, you need to code it yourself 2. Its a good question, I’ll look at the code and let you know if it is possible with the current code.

Okay do let me know, if there is anyway to show a particular range active.

Hello,

You can use this code:

oninit: function(instance){
    for(var i = 0, len = instance.config.ranges.length; i < len; i++){
        if(instance.config.startDate.format("DD.MM.YYYY")  instance.config.ranges[i].startDate.format("DD.MM.YYYY") &&
            instance.config.endDate.format("DD.MM.YYYY")  instance.config.ranges[i].endDate.format("DD.MM.YYYY")){
            instance.container.find(".calentim-range[data-id="i"]").click();
            break;
        }
    }
}

arkadaşım selamlar. Calentim DateTimeRangePicker ürününüzü satın aldım ve mükemmel diyorum tebrikler. sorum ise şu ki umarım örnek verme ihtimaliniz vardır. onafterselect sonrası cookie ya da session a veri yazdırabilmem için elinizde örnek var mı ? asp.net web form kullanıyorum.

arkadaşım anlık cevabın için çok teşekkür ederim.deneyeceğim ve umarım başarırım :) saygılar sayın taha.

Rica ederim, kolay gelsin :)

arkadaşım tekrar selam ve yönlendirmiş oldugun bilgi ile tek request olarak cookie ye set etmeyi kesinlikle başardım ve tekrar çok teşekkür ederim arkadaşım ve çalışmalarında başarılar. saygılar.

Taha bey merhaba , calendar çok iyi ve başarılı şekilde çalışıyor . Ancak ufak birkaç konuda desteğinize ihtiyacım var .

1. Geçmiş tarihleri ve 25 yıl sonrasından itibaren tarih seçimlerini disable etmek istiyorum. yani bugun 18 KASIM 2019 olduğunu varsayarsak 15 16 17….. KASIM 2019 disable olacak ve 18 Kasım 2044 Sonrası iptal olması gerekli . < 18 kasım 2019 …. xxxx …. 18 kasım 2044 >

2. (Bootstrap 4.1.3) column içerisinde inline olarak kullanıyorum ve genişliğin full-width olması gerekli yani genişliği 100% olarak tanımlamam gerekli . CSS dosyasını inceledim ancak doğru satırı bulamadım.

Yukarıda belirttiğim konular hakkında yardımlarınızı önemle rica ediyorum tekrardan emeğinize sağlık .

Merhaba,

1. minDate ve maxDate ayarlarını şöyle set edebilirsiniz:

minDate: moment(),  // bugünden öncekileri iptal eder
maxDate: moment.year(2044), // bugünün tarihinin 2044 yılından sonrakileri iptal eder
hideOutOfRange: true // disable tarihlerdeki okları göstermez

2. oneCalendarWidth değeri bir takvimin ne kadar yer kapladığını ayarlar, bunu ‘auto’ olarak set ederseniz bulunduğu container’i kaplayacaktır.

Son ayar:

.calentim({
    minDate: moment(),
    maxDate: moment().year(2044),
    hideOutOfRange: true,
    oneCalendarWidth: 'auto',
    inline: true
});

The mobile calendar is throwing errors on cancel operation. This is not an implementation issue but more of code level break on the plugin website as well. On Cancel button click – this.config.onCancel is not defined. Please validate. This is a blocking issue on mobile screens.

Yes thanks for letting me know, I should fix it ASAP. BTW, a quick fix for that is to add this to your initialization:

onCancel: function() { return true; },

Whenever the picker is changing the datetime value of an input, the input field change event aren’t triggered. So if you’re trying to monitor the actual field for changes: $(”#pickerInputField”).change(function() { }); it won’t be triggered. you should call the .change() method whenever you’re changing the input value. i could use the package events to do so but they aren’t covering all the scenarios.

Yes, but doesn’t onafterselect event run after the time change occurs? About npm, I might need to add a licensing system to handle the plug-in downloads. As this is a paid plug-in I don’t want to make it public.

>doesn’t onafterselect event run after the time change occurs It only occur after date select, if you change the time it doesn’t. also, if i manually change the actual value of the field it won’t be triggered.

Hello YahavS, I’ve checked the code and I saw that I’ve separated the time picker event as “ontimechange(instance, start, end)”. Will it work for you?

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey