Changing the format of today when used in Rules

Forums Dynamic Forms for SharePoint Changing the format of today when used in Rules

This topic contains 3 replies, has 2 voices, and was last updated by  Alexander Bautz 2 months ago.

  • Author
    Posts
  • #22053

    Eric Dickerson
    Participant

    I am working on a site with the (sharepoint setting) Canadian Date format of YYYY-MM-DD. When I use rules to set these date fields as [today] (specifically I am using [today]#now) the format is entered as 10/09/2018 which is wrong (in SP’s opinion) and Sharepoint gives the error: Enter a date and time like this: 2012-02-23 2:25 PM.

    Is there a way to set the format of the function [today] to be YYYY-MM-DD ??

    Thanks!!

  • #22057

    Alexander Bautz
    Keymaster

    I might have missed the Canadian LCID in the date format settings in DFFS. Please hit F12 to bring up the dev console, and type this:

    _spPageContextInfo.currentCultureLCID

    What is the LCID?

    Alexander

  • #22070

    Eric Dickerson
    Participant

    Looks like it’s 4105

  • #22072

    Alexander Bautz
    Keymaster

    I had the wrong format for this LCID – I used d/m/y, but will change it in the next release.

    You can fix it in your form by adding this to the top of your Custom JS:

    spjs.dffs.data.lcidToDateFormat["4105"] = "y-m-d";

    Let me know how this works out.

    Alexander

You must be logged in to reply to this topic.