Add a month / year field

elmarra

Member
Hello to all, I need to enter a month year field, for example January 20, February 20 etc. So that every month I can then group the data by month. I tried to do it with a date field by setting only (m-Y) even if the name did not come out it could be fine, but when I go to group they were grouped individually because it also took into account the time, even if it disabled. How can I add a field file that automatically adds the current month and year to me? If possible with the name of the month. I want to make sure that when new data is entered, the current month is automatically taken and saved Thanks
 
If you only want to set it as default in a new record you can also use a simple field element with Default set to "Eval" and something like
return date("m-Y");
 
If you only want to set it as default in a new record you can also use a simple field element with Default set to "Eval" and something like
return date("m-Y");
Hello I had already tried .. but "m-Y" doesn't work for me .. it is displayed as written. it works for me only if I try to enter {year} and it works for me only the year but not the month ..
Am I wrong something?

I use the calc element to do mathematical calculations .. but I don't know how to do this thing of inserting month and year .. do you have any example?
 
It's the same code for default eval or for the calc element and it's definitivly working.
 
l'immissione di {mY} non funziona
Funziona solo se inserisco {year} e mi dà l'anno corretto ..
Forse ho sbagliato a inserire il codice ... potresti gentilmente indicarne uno?
 
Perfect! Now grouping works perfectly for me!
Adding "F-Y" and displaying the month name also works .. but the month names are published in English. How can I do to view them in Italian?
Excuse me but I am very rusty with php.
Thanks again
 
Last edited:
Thanks! It works perfectly! And this .. also helps me to understand a lot :) I'm grateful to you!
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top