datepicker: how to use server side timezone to display in calendar

Hello,

For datepicker, how can I configure the today day regarding timezone of server (UTC) and not local ?
From date I can get the UTC time, but how I can’t provide this in datepicker to highlight today with UTC time and the button today select this day ?

Note:

  • On server side we have snapshot of database each day (at 00:01 UTC) and we can select a snapshot from the datepicker.

Regards,

Hello,

By default, the ‘Today’ button sets the date generated by Javascript new Date() method. You can provide a custom date via a full syntax for Calendar icons:

{ view:"datepicker", label:"My date", suggest:{
      type:"calendar",
      body:{
      	icons:[
              {/*config of the 'Today' button*/},
	          {/*config of the 'Clear' button*/}
        ]
      }
}}

Check the related snippet, please: http://webix.com/snippet/eb306896

Hello,

Thanks for the response. That working well.

Do you have also a solution to set the “today highlight” with the same value ?

Regards,

There’s no ready-made solution for such a use case, but you can work it around by the following actions:

Firstly, you need to cancel highlighting of the ‘webix_cal_today’ CSS, so you remove the green border from the unnecessary cell;

Secondly, you need to provide a custom CSS class by the events Calendar property for the needed date and set the same styling for this custom class.

Check the snippet please: http://webix.com/snippet/6dc168ac.

Btw, to apply this styling to all webix Calendar widgets globally, just remove the “mycalendar” css.

FInally the solution I implement with help of support:

  1. Cancel highlighting of the ‘webix_cal_today’ CSS, so you remove the green border from the unnecessary cell;

2)Provide a custom CSS class by the events Calendar property for the needed date and set the same styling for this custom class.

see snippet: http://webix.com/snippet/3638ecd3

Thanks the support