Skip to main content
November 1, 2021
Question

Date

  • November 1, 2021
  • 2 replies
  • 0 views

How can I put the date by dd/mm/yyyy in the following:

a!textField(
label: "Reembolso efectuado",
labelPosition: "ABOVE",
value: today(),
saveInto: ri!reembolso.fechaReembolso,
readOnly: true,
validations: {}
)

    2 replies

    mikes0011
    Brainy
    November 1, 2021

    It'd be more helpful if your subject line could be more than one word, for future reference.

    To give a date a particular formatting in text when using for read-only purposes, you will use the text() function, which accepts a value and a formatting.

    Additionally, if your text field is Read-Only, there is no need to set a "saveInto" as the save will never be executed when the field is read-only.  If you need to set the rule input value to the value "today()", you will need to include this within a saveInto of a component the user interacts with.

    The Expression Guru
    November 1, 2021

    Thank you it was very helpful