Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kåre Mai 45 posts 283 karma points
    Dec 04, 2023 @ 09:48
    Kåre Mai
    0

    Date picker - Change start of week day

    Hi,

    The Date Picker control has Sunday as the start of week day, which is very confusing. How do i change this to be Monday?

    Seems like something you should be able to configure with ease.

    The backend language has to be English.

    EDIT:

    I tried changing "firstDayOfWeek" inside the default.js file for flatpickr in the wwwroot\umbraco\lib\flatpickr\l10n\default.js but this doesn't change the first day of week in Umbraco itself.

  • Bjarne Fyrstenborg 1286 posts 4060 karma points MVP 8x c-trib
    Dec 04, 2023 @ 12:33
    Bjarne Fyrstenborg
    101

    Hi Kåre

    Currently this is not possible to change OOTB, but there's an open PR to change this in future: https://github.com/umbraco/Umbraco-CMS/pull/14996

    However for now you could create a custom property editor using the <umb-date-time-picker> component.

    You can make an copy of https://github.com/umbraco/Umbraco-CMS/tree/contrib/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker but remember to change the controller name to something unique.

    However even better if we can create a custom property editor via C# or a package.manifest re-using the datepicker view, but override the configuration.

    Unfortunately setting this in configuration won't have any effect.

    {
        "propertyEditors": [
            {
                "alias": "My.Custom.DatePicker",
                "name": "Custom DatePicker",
                "icon": "icon-calendar",
                "group": "Common",
                "editor": {
                    "view": "datepicker",
                    "supportsReadOnly": true,
                    "config": {
    
                    }
                }
            }
        ]
    }
    

    since this firstDayOfWeek isn't configurable in datePickerConfig object. https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js#L49-L63

    For now the best one can do, is propbably to create a custom property editor.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies