Set Current date as Max Date in Calendar Widget Kony Visualiser - temenos-quantum

I am developing an application with Kony Platform. I need to use a Calendar widget wherein I need to restrict selection of future dates. Is it possible? If yes, then how?

You need to set validEndDate properties as current date for the calendar widget. Please find the Same code
var mydate = new Date();
var currDate =[mydate.getDate(), mydate.getMonth() + 1, mydate.getFullYear()];
frmlanding.cal1.validEndDate = currDate;

Related

Zoho Creator -- Get calendar date from calendar report and paste into another form

I have a calendar report. when i click on a date, i want a different form to open, not the form that the calendar report is based on. Then i want the date value from the first form to be passed to the second form. So far, I have this code, on load of the Calendar Form:
MyDate = input.Departure_Date_Time;
//return same window to calendar report
openUrl("https://app.zohocreator.com/ccimailzoho/interhof-travel-
calendar#Calendar","same window");
//open trip form in popup
openurl("#Form:Trip_Form","popup window");
//Trip_Form.Departure_Date_Time = MyDate;
But it doesn't work; MyDate variable does not hold the value between the two forms. Any ideas?
For future viewers, if you want to set a value of a form on open from a different form, you can set the value directly in the openurl statement:openurl("#Form:Trip_Form?Departure_Date_Time=" + input.Departure_Time + "&Arrival_Date_Time=" + input.Departure_Time,"same window");

Is there a way to set the view on the kendo datepicker

I'm using the date picker to allow a user to select start and end dates.
When the page first loads, both date pickers will display the current month the first time the calendar is opened.
However, I want the start datepicker to open up a view from one year in the past.
I've looked through the api (options and methods) and haven't found anything to specify a month.
Has anybody tried this?
I don't quite get what view means. Just shooting in the dark - if you want to limit the start to 1 year in the past or on certain month in the past, there is a configuration option min.
From the Kendo examples:
<input id="datepicker" />
<script>
$("#datepicker").kendoDatePicker({
min: new Date(2011, 0, 1) // sets min date to Jan 1st, 2011
});
</script>
Update:
var datepicker = $("#datepicker").data("kendoDatePicker");
var d = new Date ();
$("#datepicker").kendoDatePicker({
value: new Date (d.setFullYear(d.getFullYear() - 1))
});
So this should open the "view" at this day 1 year ago. Live at the Dojo
There is a property called dateView that can have the value set.
Dojo Demo
var datepicker = $("#datepicker").data("kendoDatePicker");
datepicker.bind('open', function() {
if (this.value() !== this.dateView.value()) {
this.dateView.value(null);
}
});
datepicker.dateView.value(dt);
This will update the value in the popup calendar without updating the value of the widget itself.
Edit: This actually causes a bug where clicking the selected dateView value doesn't update the actual picker value. I've added a handler for the open event to take care of the mismatch and clear the selected dateView value.

kendo datepicker - set date without looking maxdate

I have one kind of scenario using date picker. I have date picker with max date=current date + 10 days,on page load only i want to show date more than the max date,but I'm allowing user to enter only up to max date. Is it possible. Without looking maxing date i want to display only the date what ever i want.code:-
var datepicker = $("#date" + uid).data("kendoDatePicker");
var addDays = new Date();
if (arr[1] == "") {
var d = new Date();
datepicker.min(new Date());
datepicker.max(new Date(d.getDate() , d.getMonth(), d.getDate()+ parseInt(arr[1]) - parseInt(1)));
}
I don't know if this is achievable. But what if you try to add two date pickers instead? One that display only the text, and the other only the calendar button. You need to play a bit the CSS, but I think it could spare you a lot of time.

Jquery full calendar

How do I remove the past dates from the full calendar. SO when the calendar loads it should display only current month's date. I could disable the past dates but I need to remove it from the current month.
Use the property visStart, this will let you control what the first visible day on the calendar is. You can set that to DateTime.Now() (c#) or Now = new Date() (javascript)
http://arshaw.com/fullcalendar/docs/views/View_Object/
This will stop the past dates from showing up the calendar.
I don't have the solution for removing dates, but this is what I'm using for when someone clicks on a date and trying to make an appointment thats in the past.
var date = new Date();
select: function(start, end, allDay) {
if(start < date) {
alert('Cannot select past dates.');
return;
}
},

MATLAB date selection popup calendar for gui

Does anyone know of a method to display a popup date selection calendar in a MATLAB gui? I know the financial toolbox has a uicalendar function, but unfortunately I don't have that toolbox.
I have a hunch I'm going to have to use some Java or some other language for this one, which I know nothing about.
I'm looking for something similar to this:
(source: welie.com)
which would return a date string after the user selects the date.
Here are two approaches that would give you a professional-looking calendar component in Matlab without too much programming work:
Use a Java calendar component (for example, one of these or these). Once you download the relevant Java class or Jar-file, add it to your static Java classpath (use the edit('classpath.txt') command from the Matlab Command Prompt). Finally, use the built-in javacomponent function to place the component in your Matlab figure window.
If you are using a Windows OS, you can embed any Active-X calendar control that is available. Use the built-in actxcontrolselect function to choose your favorite calendar control (for example, Microsoft Office's "Calendar Control 11.0" - MSCAL.Calendar.7 - which is automatically installed with Office 2003; or "Microsoft Date and Time Picker Control 6.0" - MSComCtl2.DTPicker.2, or ...). Then use the actxcontrol function to place the component in your Matlab figure window.
Matlab has some pretty useful built-in calendar (date-selection) controls - I posted an article about them today
I don't have much time for a more complete answer, unfortunately, but I'd try uitable to create a table and to define the CellSelectionCallback to get the date.
Here's a bit to get you started:
dates = calendar;
dates(~any(dates,2),:) = [];
fh = figure;
uh = uitable('parent',fh,'data',dates,'ColumnWidth',repmat({20},1,7),...
'ColumnName',{'S','M','T','W','T','F','S'});
I'd start with the calendar() function which outputs a matrix containing the calendar for any month. I assume you could combine this with a user-clickable interface to retrieve a specific date?
The following code is really ugly, but could help you get started...
WINDOW_WIDTH = 300;
WINDOW_HEIGHT = 200;
f= figure('Position',[300 300 WINDOW_WIDTH WINDOW_HEIGHT]);
NB_ROWS = 6;
NB_COLS = 7;
width = round(WINDOW_WIDTH/NB_COLS);
height = round(WINDOW_HEIGHT/NB_ROWS);
buttons = nan(NB_ROWS,NB_COLS);
dates = calendar();
for row = 1:NB_ROWS
for col = 1:NB_COLS
if dates(row,col) == 0
mydate = '';
else
mydate = sprintf('%i', dates(row,col));
end
buttons(row,col) = uicontrol('Style', 'PushButton', ...
'String', mydate, ...
'Position', [(col-1)*width (NB_ROWS - row)*height width height]);
end
end

Resources