Lookup of dates

Forums SPJS-Lookup Lookup of dates

This topic contains 5 replies, has 2 voices, and was last updated by  Alexander Bautz 1 year, 10 months ago.

  • Author
    Posts
  • #8657

    lzuhuo
    Participant

    Hi Alex, How can I set my lookup field in date format? It appears like “2015-10-07 00:00:00”, I’d like to be in “dd/mm/yyyy” format, but in order of dates.

  • #8750

    Alexander Bautz
    Keymaster

    Hi,
    Sorry for the delay – can you give me some more information? – is it a Lookup column, or a vLookup column in DFFS you are referring to?

    Alexander

  • #9403

    lzuhuo
    Participant

    Lookup column

  • #9412

    Alexander Bautz
    Keymaster

    I see. Unfortunately this is the way the value is returned by the query. Your best option would be to add a calculated column with a formula returning your preferred date format – using this new column in your “spjs-lookup” column.

    Alexander

  • #9427

    lzuhuo
    Participant

    Sure, but how can I filter this dates based on value of “today”? For example, dates which has values less than today, I would like to not show them

  • #9442

    Alexander Bautz
    Keymaster

    Try using a CAML like this in the “filterObj”:

    <Where>
    <Geq>
    <FieldRef Name='EventDate' />
    <Value Type='DateTime'>
    <Today />
    </Value>
    </Geq>
    </Where>

    Change the “EventDate” to match your field.

    Alexander

You must be logged in to reply to this topic.