Closed gsaikrishna32 closed 4 years ago
@gsaikrishna32 You can check markDisabled option in README.
can I display the calendar in pop up?
sry bro i had got calendar but how i wanted to display it in pop up
@gsaikrishna32 What kind of popup are you using? Is it an Ionic component? I think you just need to declare the calendar in the popup page. It may require some css tuning depending on the popup component you use. But I personally don't like popup, as the mobile phone is already very small, if you want to display something in a popup window, it's not easy to select things inside that window.
disabling the dates is not working fyn can u send me the changes in markDisabled option
@amulyadande Did you try the code snippet in README?
<calendar ... [markDisabled]=“markDisabled”></calendar>
markDisabled = (date: Date) => {
var current = new Date();
return date < current;
};
i wrote the same code what actually u sent to me bt it is not responding anything, it is showing blank page no output nd no errors
On Thu, Mar 23, 2017 at 7:52 PM, twinssbc notifications@github.com wrote:
@amulyadande https://github.com/amulyadande Did you try the code snippet in README?
<calendar ... [markDisabled]=“markDisabled”>
markDisabled = (date: Date) => { var current = new Date(); return date < current; };
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/twinssbc/Ionic2-Calendar/issues/60#issuecomment-288734462, or mute the thread https://github.com/notifications/unsubscribe-auth/AZYzG8C2onWNFoStwNpe8wfixbolksGOks5rooAogaJpZM4MG-Gp .
If you remove the markDisabled attribute, does it display correctly?
I have the same problem, the markDisabled event only fires when I select the date or time, but I want to hide it when rendering or disabling the tap event and putting it in another color
@ALSephirot markDisabled should be fired when rendering. Is it possible you bind markDisabled to some timeSelected event?
Sorry @twinssbc , but markDisabled is never called during rendering. By looking at the code I see that the only call is made in the select method of the views. For example, for WeekViewComponent at line 366.
@gmarab markDisabled is called when rendering the monthview, not applicable to the weekview and dayview.
@twinssbc is there a way to disable specific dates? For example, Oct. 15, Oct 17, Oct 21, Oct 26 will the ones to be disable only in the calendar.
@frixtiglao You could use markDisabled callback method. You just need to check if the date argument equals to the dates you want to disable.
@twinssbc I am using the call back method of the markDisabled but when I put for example "return date = current_date" it will not disable the current date rather it will disable all the dates from the calendar. If you can give a short code example on how to achieve the disabling specific dates, I would really appreciate it. Thanks in advance!
@frixtiglao Although they may be the same date, but == will treat them as two different objects. You need to compare them with the timestamp. For example,
markDisabled = (date: Date) => {
var checkDate = new Date(2017, 9, 14, 12, 0, 0);
return date.getTime() == checkDate.getTime();
}
@twinssbc Thank you it worked! I will further test the code.
@twinssbc Can we set date into ion2-calendar when it render and then select date which we want in monthview? and how to load the specific date month in ion2-calendar? for ionic 2
@krunal9421 Could you create a separate issue? This question is not relevant to the issue.
Hi Can you please tell me how to block swipe 2 months before this month and 10 months after this month. Assume like now we are in April month , from calendar we can swipe to previous side up to January this year and swipe to forward side up to march next year. can you please tell me how block swiping after this months in ionic 2 calendar.
Thank you
@sachininara Disable swiping to previous months is easy. There's an option, lockSwipeToPrev, you could use. I didn't expose lockSwipeToNext option as I found it didn't work well. I could check again to see if Ionic team fixed it.
@twinssbc thank you very much your response. Actually this is urgent task. If you can please tell me how to disable months after 10 months from this month.
Thank you
@sachininara I just tried the lockSwipeToNext option in Ionic Slides. It still doesn't work for the looped slides. So I'm afraid your requirement can't be achieved.
Hi Thank you for your response. Actually I am thinking a way to block swiping sliders after particular range. I am in urgent task. Could you please tell me how to block swiping using calendar.js files's functions. Thank you
@sachininara As I said disabling swiping to next month doesn't work.
@twinssbc is there any way to disable previous days in week view. 'markDisabled' is working for me in month view. But I want to do same / disable days in week view too. Can you suggest me how can i do that?
@mowaiskalam , did you solde that? I have the same issue
I want to enable and disable the dates and also how can i display this calendar(UI) in pop up.