From: Kurund Jalmi Date: Fri, 3 Nov 2023 17:50:14 +0000 (+0000) Subject: add admin configuration to set the date defaults X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c692ef664aa6ed9922a0cf5b2badbc76a7d02947;p=civicrm-core.git add admin configuration to set the date defaults --- diff --git a/ext/afform/admin/ang/afGuiEditor/elements/afGuiField-menu.html b/ext/afform/admin/ang/afGuiEditor/elements/afGuiField-menu.html index 9c49cbcccd..5f01636f58 100644 --- a/ext/afform/admin/ang/afGuiEditor/elements/afGuiField-menu.html +++ b/ext/afform/admin/ang/afGuiEditor/elements/afGuiField-menu.html @@ -56,7 +56,15 @@ {{:: ts('Default value') }} -
  • +
  • +
    + +
    +
  • +
  • diff --git a/ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js b/ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js index 1b9f03495d..ace876defb 100644 --- a/ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js +++ b/ext/afform/admin/ang/afGuiEditor/elements/afGuiField.component.js @@ -53,6 +53,10 @@ this.searchOperators = _.pick(this.searchOperators, ctrl.fieldDefn.operators); } setDateOptions(); + + if (ctrl.getDefn().input_type == 'Date' && !getSet('default_date_type')) { + ctrl.defaultDateType = getSet('default_date_type', 'fixed_date'); + } }; this.getFkEntity = function() { @@ -267,6 +271,10 @@ } }; + $scope.setDefaultDateType = function() { + ctrl.defaultDateType = getSet('default_date_type'); + }; + $scope.defaultValueContains = function(val) { val = '' + val; var defaultVal = getSet('afform_default');