Hi All, Can we show only mm/YYYY instead of dd/mm/yyyy in date field ...Thanks in advance
Discussion posts and replies are publicly visible
Please try using text() function. It should serve your purpose.
text( today(), "MM/YYYY")
No. you cannot change the format of date within a date field but to display a read-only date using a custom format, use a text component.
Ravi Roshan said:text( today(), "MM/YYYY")
This can be used in a text field as 'value' attribute, keeping it as read-only.
As others have highlighted, date fields cannot currently be modified to show dates in different formats. a mixture of the datefield and textfield can help achieve your desired functionality (though i would recommend using datetext() instead of text())
Datetext documentation: https://docs.appian.com/suite/help/19.1/fnc_scripting_datetext.html
Example sail:
{ a!dateField( label: "Date", value: ri!date, saveInto: ri!date, align: "RIGHT", showWhen: not(ri!readOnly) ), a!textField( label: "Date", value: datetext(ri!date,"mm/yyyy"), readOnly: true, align: "RIGHT", showWhen: ri!readOnly ) }
If you are just trying to capture the month and year as input consider using a side by side layout with dropdowns or free text.