Skip to main content
Known Participant
May 14, 2024
Question

C'è un modo per inserire in un campo modulo ogni lunedi la data

  • May 14, 2024
  • 1 reply
  • 459 views

Buongiorno, chi mi aiuta ad inserire in un campo modulo "data" con aggiornamento della data in automatico ogni lunedì.

grazie

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
May 14, 2024

What do you mean? Do you want the field to show the latest Monday whenever the file is opened?

 

Known Participant
May 14, 2024

NO! Es: se oggi 13/05/24 ed è lunedì, voglio che il campo "data" si aggiorni in automatico al prox lunedi 20/05/24 e così via..

grazie

try67
Community Expert
Community Expert
May 14, 2024

OK! ... You can do it by placing this code as a doc-level script in your file:

 

var d = new Date();
while (d.getDay()!=1) d.setDate(d.getDate()+1);
this.getField("date").value = util.printd("dd/mm/yyyy", d);