Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to user time in 24 hours instead of AM/PM on day grid? Current time is show correctly... #1438

Open
fellipeh opened this issue Jan 19, 2024 · 3 comments

Comments

@fellipeh
Copy link

I would like to use 24hours instead AM/PM on a day grid, but I couldn't find where I set this.. but, current time is showing correctly, please see the above screenshot:

image

@yechukim
Copy link

I think you can customize using timegridDisplayTime
it's in template options

calendar.setOptions({
  template: {
    timegridDisplayTime({ time }) {
      return `sub timezone: ${time}`;
    },
  },
});

@Zyron
Copy link

Zyron commented Jan 24, 2024

@fellipeh This gives you 24 hours:

            timegridDisplayPrimayTime: function(time) {
                return time.hour + ':00';
            },
            timegridDisplayTime: function(time) {
                return time.hour + ':00';
            }

@JangwonLim
Copy link

JangwonLim commented Jan 25, 2024

I use React JS and it worked for me, so try this:

        timegridDisplayPrimaryTime({ time }) {
          var hour = time.getHours();
          var formattedHour = hour < 10 ? '0' + hour : hour;

          return `${formattedHour}:00`;
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants