Trying to Set DateTIme field in CustomJs

Forums General discussion Trying to Set DateTIme field in CustomJs

Viewing 1 reply thread
  • Author
    Posts
    • #36099
      Moreshwar Shelar
      Participant

      HI,
      I am trying to set dateTime field to current date and time (EST) (no matter what the client browser is having timezone, going to record EST time).

      For above we have written logic to find EST time in CustomJs Section (works well) but while setting the datetime to Field (which is dateTime field) it rounds off to %5 value. e.g if est time is 10:29 it rounds off to 10:30 (i am expected to record 10:29).

      Can you help me to record exact timestamp?

      I already tried – SetFieldValue, SPJS.Utility.SetDateFieldAsDateObject methods with minute and second parameters too.

      Your help is appreciated.

    • #36100
      Alexander Bautz
      Keymaster

      The time picker in a date and time field in a SharePoint form has 5 minute intervals and it is impossible to add a minute value outside this preset interval. This is unfortunately not something that can be overridden (it is in the out of the box SharePoint code and not controlled by DFFS).

      Because you cannot save the form if you insert an invalid value (a value not in the minute-picker) the DFFS function used to update the picker will round it to the nearest 5-minute mark.

      Alexander

Viewing 1 reply thread
  • You must be logged in to reply to this topic.