Hi, I have a requirement of creating a field (week date) in a page types which gets the current week date as a default value. This could be done with macro in the default value property but dont know how to do that. Does anyone know how to achieve this or a macro method to get current week date. Week starts from Friday to Thursday. So any page create during that week will have the same week date in the "week date" field. Thanks in advance
This will give you the week of the year:{% Floor((DateTime.Now.DayOfYear/7) + 1) |(identity)GlobalAdministrator%},i.e. if you are counting full weeks or not, etc.
{% Floor((DateTime.Now.DayOfYear/7) + 1) |(identity)GlobalAdministrator%}
Thanks, Now I could get week number, which should be fine.
Please, sign in to be able to submit a new answer.