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

Change duration format #333

Open
rhuanbarreto opened this issue Nov 30, 2020 · 5 comments
Open

Change duration format #333

rhuanbarreto opened this issue Nov 30, 2020 · 5 comments

Comments

@rhuanbarreto
Copy link

Describe the solution you'd like
I want to display the duration in the column in hours instead of days.

@mariohmol
Copy link
Collaborator

I think this is dup to #253 (comment) right?

@rhuanbarreto
Copy link
Author

No. I don't want an hour view. I want the duration on the column to be shown in hours instead of days, weeks or months depending on the view mode.

@mariohmol mariohmol reopened this Nov 30, 2020
@mariohmol
Copy link
Collaborator

mariohmol commented Nov 30, 2020

Makes sense, so in the day view, when the duration is less than a day, show the duration in hours.

is this correct?

@rhuanbarreto
Copy link
Author

I want to have a fixed duration format independent of view. In my case, all tasks are counted in hours, so in day, week, month and quarter view, the duration will display the value I sent in hours.

@mariohmol
Copy link
Collaborator

I see.. well.. this should not be hard to implement

  1. create a new option for the gantchart will include a durationFormat.
    https://github.com/jsGanttImproved/jsgantt-improved/blob/master/src/options.ts#L77

  2. You can make a logic here using this durationFormat to change how it calculates:
    https://github.com/jsGanttImproved/jsgantt-improved/blob/master/src/task.ts#L249

  3. include the hour format here
    https://github.com/jsGanttImproved/jsgantt-improved/blob/master/src/task.ts#L263

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

No branches or pull requests

2 participants