SOTI SNAP datePicker maxDate not being set

C

In setting a max date for the datepicker named “datFueling”.

Below are the two attempts that I have made, neither seems to work.  The id of the datePicker control is "datFueling".

_________________________

var today = new Date();

document.getElementById("datFueling").maxDate = today;

 _________________________

_________________________

var today = new Date();

$("#datFueling" ).datepicker( "option", "maxDate", today);

_________________________

Any ideas?

6 years ago
SOTI Snap
ANSWERS

Hello Curly, 

Do you have any update on this?  SNAP is one of our highly anticipated newer products, perhaps I could request some assistance from one of the Product Mangers for you? 

What version of SNAP are you using?

Regards,

C
Curly
6 years ago

Our rep has given me a few ideas to try, but I haven't been able to implement them.  Minor detail though, we are LOVING Snap!

If you could try to test the code below, it would be appreciated :)

'' Here is the code that we are to try.

var widgetId = "<dateId>";

var daysToAddInMaxDate = 2; //(days)change this as required

changeMaxDate(widgetId,daysToAddInMaxDate);

function changeMaxDate(widgetId,daysToAddInMaxDate){

var widgetDataGenyId = $("#" + widgetId).attr("data-geny");

appWidgetConfigurations[widgetDataGenyId].widgetConfiguration.maxDate = UtilityModule.formatDateToString(new Date(new Date().setDate(new Date().getDate() + daysToAddInMaxDate)));

if (appSavedData) {

    //app preview only

    $("#" + widgetId).datepicker("destroy");

}

}

VM
Varun Mittal
6 years ago

Hello Curly,

Apologies for the late reply.

I am sorry to know that you are facing issues in setting up the logic in your App.

I would like to understand your usecase. Kindly help me with the following questions:

- Why do you want to dynamically set max date as Today?

- If you are not able to do, what will be the impact on your business process?

Solution -

It seems that you are trying to control the property which is not supported via DOM APIs. Also, the validations framework will not be able to pick it. It can only be supported once we provide our own client JS API. Also, within IDE itself, we will evaluate if user can configure the max date as “Today”. Kindly help us with the answers to the questions as asked above. 

Side Note: How is your experience otherwise in using SOTI Snap?

Any chance you are attending Sync event? I would love to catch up with you.

Thanks,

Varun Mittal

C
Curly
6 years ago

Thanks for the reply.

The use case for setting the date dynamically to "today" is so that users can not submit records in the future.  An alternative would be to check the date before the submission is made with Javascript, but it will be a "clunkier" solution.  (in that it will be an error that looks unlike the other validation on the form)

It is a minor point.   The liability we have is with an auditor who might ask if users can put in dates that fictitious.  If that becomes an issue we will put in the Javascript check.

We are loving SNAP and we have done so well with the initial app, that I am looking for other processes that can be streamlined with SNAP.

I will not be able to attend SYNC this year, but hopefully next year.  Keep up the great work!

Thanks,

Terry

VM
Varun Mittal
6 years ago

Hey Curly, putting validation on entered date through JS action sounds like a nice alternative! Please go ahead.

Would like to know more about the processes you are looking to automate with Snap. Do keep us posted.

All the best,

Varun M