From 1d073f45b471aa8bf14c5e463a32ba501159de24 Mon Sep 17 00:00:00 2001 From: rogercreagh <44980188+rogercreagh@users.noreply.github.com> Date: Fri, 25 Apr 2025 07:54:56 +0100 Subject: [PATCH 1/3] Update calendar.md added info re setting default date to current date --- docs/general-concepts/forms-fields/standard-fields/calendar.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/general-concepts/forms-fields/standard-fields/calendar.md b/docs/general-concepts/forms-fields/standard-fields/calendar.md index b5359fbe..62c060ab 100644 --- a/docs/general-concepts/forms-fields/standard-fields/calendar.md +++ b/docs/general-concepts/forms-fields/standard-fields/calendar.md @@ -30,6 +30,7 @@ the text box. Otherwise the default value, if any, is displayed. - **filltable** (optional): if set to true, dates of the previous and next month are added at the top and bottom of the current month to fill the grid. Defaults to true. - **minyear** (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user cannot select a year before this limit. If zero, which is the default, there is no limit. - **maxyear** (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user cannot select a year after this limit. If zero, which is the default, there is no limit. +- **default** (optional): a default date can be specified in `Y-m-d` format. You can default to the current date by using `default="now"` Implemented by: libraries/src/Form/Field/CalendarField.php From 9426174e3b514c741a5d297ae7a72579af4fb357 Mon Sep 17 00:00:00 2001 From: rogercreagh <44980188+rogercreagh@users.noreply.github.com> Date: Sat, 26 Apr 2025 12:16:05 +0100 Subject: [PATCH 2/3] Update calendar.md added clarification in response to comment --- docs/general-concepts/forms-fields/standard-fields/calendar.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/general-concepts/forms-fields/standard-fields/calendar.md b/docs/general-concepts/forms-fields/standard-fields/calendar.md index 62c060ab..0e9e4f43 100644 --- a/docs/general-concepts/forms-fields/standard-fields/calendar.md +++ b/docs/general-concepts/forms-fields/standard-fields/calendar.md @@ -30,7 +30,8 @@ the text box. Otherwise the default value, if any, is displayed. - **filltable** (optional): if set to true, dates of the previous and next month are added at the top and bottom of the current month to fill the grid. Defaults to true. - **minyear** (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user cannot select a year before this limit. If zero, which is the default, there is no limit. - **maxyear** (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user cannot select a year after this limit. If zero, which is the default, there is no limit. -- **default** (optional): a default date can be specified in `Y-m-d` format. You can default to the current date by using `default="now"` +- **default** (optional): a default date can be specified in `Y-m-d` format. You can default to the current date by using `default="now"` as the xml attribute. + You can also directly set the date to the current day by typing the word "now" into the rendered text box instead of pressing the "Today" button Implemented by: libraries/src/Form/Field/CalendarField.php From 037bba82e6ba8c7cb46b0de4ad42f73152f4e80e Mon Sep 17 00:00:00 2001 From: rogercreagh <44980188+rogercreagh@users.noreply.github.com> Date: Sat, 26 Apr 2025 14:34:09 +0100 Subject: [PATCH 3/3] Update docs/general-concepts/forms-fields/standard-fields/calendar.md better Co-authored-by: Harald Leithner --- docs/general-concepts/forms-fields/standard-fields/calendar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general-concepts/forms-fields/standard-fields/calendar.md b/docs/general-concepts/forms-fields/standard-fields/calendar.md index 0e9e4f43..cb4ee8dd 100644 --- a/docs/general-concepts/forms-fields/standard-fields/calendar.md +++ b/docs/general-concepts/forms-fields/standard-fields/calendar.md @@ -30,7 +30,7 @@ the text box. Otherwise the default value, if any, is displayed. - **filltable** (optional): if set to true, dates of the previous and next month are added at the top and bottom of the current month to fill the grid. Defaults to true. - **minyear** (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user cannot select a year before this limit. If zero, which is the default, there is no limit. - **maxyear** (optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user cannot select a year after this limit. If zero, which is the default, there is no limit. -- **default** (optional): a default date can be specified in `Y-m-d` format. You can default to the current date by using `default="now"` as the xml attribute. +- **default** (optional): a default date can be specified in `Y-m-d` format. You can default to the current date by using `now` as the xml attribute value. You can also directly set the date to the current day by typing the word "now" into the rendered text box instead of pressing the "Today" button Implemented by: libraries/src/Form/Field/CalendarField.php