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

Add a prop to the header.vue component to specify short or long date #261

Open
JimRomaineHRI opened this issue Sep 28, 2024 · 1 comment

Comments

@JimRomaineHRI
Copy link

Is your feature request related to a problem? Please describe.
The calendar header displays short name for Month
image

Describe the solution you'd like
Pass a prop monthFormat and possibly dayFormat (that could stay short due to date picker ) that would accept either short or long minimally and have that value used in header.vue component. Computed value for period name

periodName() {
  if (this.mode === 'week') {
    const startMonth = this.time.getLocalizedNameOfMonth(
      this.currentPeriod?.start,
      this.monthFormat
    );
    const endMonth = this.time.getLocalizedNameOfMonth(
      this.currentPeriod?.end,
       this.monthFormat
    );

    return startMonth === endMonth
      ? startMonth
      : `${startMonth} - ${endMonth}`;
  }

  // day
  return (
    this.time.getLocalizedNameOfMonth(
      this.currentPeriod?.selectedDate,
      'short'
    ) +
    ' ' +
    this.currentPeriod.selectedDate.getFullYear()
  );
},

Additional context

Would like the option to display long Name
image

@JimRomaineHRI
Copy link
Author

Just happened to notice the schedule-x project that appears to have this formatting on dates. will check that out.

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

1 participant