0

I'll try to set a date field within a SharePoint 2016 new-, or edit form via jQuery.

Works fine so far:

fieldJqueryObject.find('input[type="text"]').val('08/28/2019')

The problem: It works only if I send the string according to the format set up in the site settings (here: MM/DD/YYYY). If, for instance, I use the German format in regional settings (DD.MM.YYYY) it won't work if I write the english value in the field.

Of course, reading the value also is a problem. Can I retrieve the date/time format via REST API or something like that?

1 Answer 1

1

It's a half solution but you can try it. If you enter dd/MM/YYYY, it should work.

You can get the regional settings using REST API as shown below.

https://spdev.sharepoint.com/sites/SPTeam/_api/web/RegionalSettings/

You can get the date format number and date separatore using the above api

or

https://spdev.sharepoint.com/sites/SPTeam/_api/web/RegionalSettings/TimeZone

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.