Plumsails Lookup item format

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Mapleleaf
Posts: 29
Joined: Tue Oct 25, 2016

23 Nov 2016

I have a plumsails lookup-field, which shows the Lookup-item an in addition another column from the target-list. This column ist a date-field.

When I display this date with the item-format Item['Datefield'] it shows the date like "yyyy-mm-ddThh:mm:ssZ".


How can I display the date like dd.mm.yyyy?

YuriyMedvedev
Moderator
Posts: 33
Joined: Wed Sep 21, 2016

23 Nov 2016

Hi! Use this code in Item Format, please:

Code: Select all

function(item) {
  function format(dateString) {
    if(!dateString) return dateString;
    var result = new Date(dateString).toLocaleDateString();
    return result;
  }
  return '<span class="csl-option">' + format(item["{LookupField}"]) + '</span>'
}

Mapleleaf
Posts: 29
Joined: Tue Oct 25, 2016

23 Nov 2016

Works great. Thanks.

As I wanted no weekday i changed this line:

var result = new Date(DateString).format("dd.MM.yyyy");

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests