Our pure JavaScript Scheduler component


Post by eugenem »

How do I change to a 24-hour format? Now it's in AM/PM mode.


Post by pmiklashevich »

Pavlo Miklashevych
Sr. Frontend Developer


Post by eugenem »

thanks!

this worked for me:

    const locale = {

  // ... Other translations here ...

  PresetManager: {
    // Translation for the "weekAndDay" ViewPreset
    hourAndDay: {
      // Change the date format for the top and middle levels
      //topDateFormat: 'MMM',
      middleDateFormat: 'HH:mm'
    },
  }
}

LocaleManager.extendLocale('En', locale);


Post by eugenem »

this is cool for the timeline, but how do I change the editor format?


Post by alex.l »

HI eugenem,

I am not sure I got your question. Did you change DateHelper locale as it recommended in the guide?https://www.bryntum.com/docs/scheduler/#guides/customization/localization.md#change-date-formats

const locale = {
    DateHelper : {
        locale : 'es-ES'
    }
}

LocaleManager.registerLocale('Es', { desc : 'Spanish', locale : locale });

All build-in editors and inputs are using the current locale date format that depends on the locale of your browser/OS according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat

All the best,
Alex


Post by eugenem »

    const locale = {

  // ... Other translations here ...

  PresetManager: {
    // Translation for the "weekAndDay" ViewPreset
    hourAndDay: {
      // Change the date format for the top and middle levels
      //topDateFormat: 'MMM',
      middleDateFormat: 'HH:mm'
    },
  },
  DateHelper: {
    locale: 'en-GB'
  }
}

LocaleManager.extendLocale('En', locale);

Ok, this seems to work. But if I want to change here date format to d.m.Y, how would I do it? I'm not sure there is an EN locale variant for that.


Post by alex.l »

Where exactly do you want to see that format?

All the best,
Alex


Post by eugenem »

ok, I've managed


Post Reply