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

Provide a week view to the DateHeader component with unit="primaryHeader". #906

Open
livain18 opened this issue May 24, 2023 · 0 comments
Open

Comments

@livain18
Copy link

livain18 commented May 24, 2023

Problem:
I need to show a week view in the dynamic DateHeader Component with unit='primaryHeader', it looks like this is missing in the source code.

Fix:
I can solve by editing the source code itself by adding week string into getNextEdit function:
react-calndar-timeline > src > utility:
line 145

export function getNextUnit(unit) {
  let nextUnits = {
    second: 'minute',
    minute: 'hour',
    hour: 'day',
    day: 'week',
    week: 'month',
    month: 'year',
    year: 'year'
  }
  if (!nextUnits[unit]) {
    throw new Error(`unit ${unit} in not acceptable`)
  }
  return nextUnits[unit]
}

Is it possible to change this to the package please?

Week is missing in today's code. Is it possible to provide this? Or at least give me an option how to reach this by implementing a CustomHeader with the functionality of the DateHeader as a "primaryHeader". Because I find it impossible untill now to achieve this. Thanks in advance!

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