Our pure JavaScript Scheduler component


Post by ocl »

I am testing the new version of the scheduler with a trial version. I would like to translate the Scheduler to german. With the file schedule.locale.de.js all menus are translated correctly. Unfortunately the date formatting does not work with the PresetManager. If someone has a hint?

scheduler.locale.de.js
(3.65 KiB) Downloaded 102 times

Post by sergey.maltsev »

Hi!

There are few date formats used for PresetManager

For example

    PresetManager : {
        hourAndDay : {
            topDateFormat     : 'ddd MM/DD',
            middleDateFormat  : 'LST',
            displayDateFormat : 'll LST'
        }
    },

Please check these docs
https://www.bryntum.com/docs/scheduler/#Scheduler/preset/PresetManager#localizing-view-presets


Post by ocl »

Thanks for the prompt reply. I have adapted the format as follows:

PresetManager: {
        hourAndDay : {
            topDateFormat     : 'dd MM.DD',
            middleDateFormat  : 'LST',
            displayDateFormat : 'll LST'
        }

But the formatting still looks like this

2020-11-20_15-08-45.png
2020-11-20_15-08-45.png (4.76 KiB) Viewed 1215 times

Post by fabio.mazza »

Hi ocl,

I have modified our demo https://www.bryntum.com/examples/scheduler/localization/ changing the file Scheduler/examples/localization/locales/custom.locale.De.js the PresetManager.hourAndDay config like this:

PresetManager : {
    ...
    hourAndDay : {
        topDateFormat     : 'dd MM.DD',
        middleDateFormat  : 'LST',
        displayDateFormat : 'll LST'
    },
    ...
},

And it worked fine:

Screen Shot 2020-11-20 at 10.23.45 AM.png
Screen Shot 2020-11-20 at 10.23.45 AM.png (19.03 KiB) Viewed 1212 times

Please, on your project, run on your console (chrome dev tools) this command and make sure the result is your locale ("De"):

scheduler.localeManager.locale.localeName; // output "De"

Also check if your new date format are on scheduler.localeManager.locale.PresetManager.hourAndDay:

scheduler.localeManager.locale.PresetManager.hourAndDay;
// output:
// {topDateFormat: "dd MM.DD", middleDateFormat: "LST", displayDateFormat: "ll LST"}

If it is not applying the locale, please share your code showing how are you applying the De locale. I checked your locale file but we need to know how you are applying and/or calling/adding it to your app.

Thank you.

Best regards,
Fabio


Post by ocl »

Hello Fabio
Thanks for your answer. I have checked the variables in the dev tools

2020-11-23_07-59-38.png
2020-11-23_07-59-38.png (31.74 KiB) Viewed 1202 times

The translations are displayed correctly

2020-11-23_08-10-33.png
2020-11-23_08-10-33.png (18.58 KiB) Viewed 1202 times

I load the Js-Scripts manually by code

2020-11-23_08-11-08.png
2020-11-23_08-11-08.png (22.7 KiB) Viewed 1202 times

Post by mats »

@ocl: So everything is working now according to your expectations?


Post by ocl »

Unfortunately no, the date format was not applied.


Post by alex.l »

Hi ocl,

Could you please share your solution? We need to see how and where do you apply your localization and presets.
Meanwhile please check my response here about generic data formatting, may be helpful for you too: viewtopic.php?f=52&t=15379&p=77340&hilit=DateTimeFormat#p77340

All best,
Alex

All the best,
Alex


Post by ocl »

For testing purposes I have modified the code. The scripts are loaded directly in the Index.html. This should set the localization directly.

2020-11-24_10-53-25.png
2020-11-24_10-53-25.png (13.38 KiB) Viewed 1187 times

With ExtJs the scheduler is created. The LocalManager is set correctly

2020-11-24_10-54-14.png
2020-11-24_10-54-14.png (74.34 KiB) Viewed 1187 times

Unfortunately I cannot share this solution. With Bryntum Scheduler 2.0.0 it worked.I try to update the scheduler with the trial version


Post by mats »

@ocl What's the account with the license you used since 2.0?


Post Reply