Copy link to clipboard
Copied
I'm working on editable PDF, and I have date field where I went to populate the date in the following format;
dddd mmm/dd/yy. Friday Aug/24/18.
I need it to display the day of week, I have tried amending the date options below but the date field refuses to play ball, keeps throwing all sorts of errors?
I don't know what I'm doing wrong, can anybody help?
This code inserts creates a string with a full date in one months time in Spanish
...var meses = new Array ("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
var diasSemana = new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
var d=new Date();
var f = new Date(d.getFullYear(), d.getMonth()+1,d.getDate());
if(!this.getField("Validez").readonly) {
this.getField("Validez").value = diasSemana[f.getDay()] + ", " + f.
Copy link to clipboard
Copied
If you select that Format then you also have to enter a value that follows it... What exactly are you entering into the field?
Copy link to clipboard
Copied
I used that format and entered "24/8/18" and it worked fine, because that is a standard date format...
Copy link to clipboard
Copied
If you enter dddd mmmm dd,yyyy into the custom field on the format tab, it shows at Week Day Month day, year.
Copy link to clipboard
Copied
If the field you entered your custom date format into is an input field, then one has to enter the date that matches the specified format. A way around this would be to add an "On Focus" action to prompt for the date using the "app.response" method. You would have to perform the date validation and formatting as part of that script.
Copy link to clipboard
Copied
To clarify this is sentence below extracted from the PDF. Each of the Friday Aug/24/18 blocks shown should be a calendar drop-down that user can select the date from and then it be displayed in the format above. How do I do that? How do I make that work.
Copy link to clipboard
Copied
This code inserts creates a string with a full date in one months time in Spanish
var meses = new Array ("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
var diasSemana = new Array("Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado");
var d=new Date();
var f = new Date(d.getFullYear(), d.getMonth()+1,d.getDate());
if(!this.getField("Validez").readonly) {
this.getField("Validez").value = diasSemana[f.getDay()] + ", " + f.getDate() + " de " + meses[f.getMonth()] + " de " + f.getFullYear();}
It should be useful. I have it in Document Javascripts
Copy link to clipboard
Copied
I am an old style hacker. I love ugly hacks. My priority is that it works. I do not care about anything else. I am a damn good programmer and my code actually is maintainable but my only care is that it works. I never touch what works .