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

TimelineValue format doesn't handle milestone #231

Open
jhu321 opened this issue Nov 2, 2022 · 1 comment
Open

TimelineValue format doesn't handle milestone #231

jhu321 opened this issue Nov 2, 2022 · 1 comment

Comments

@jhu321
Copy link

jhu321 commented Nov 2, 2022

it looks like you're parsing it in the reading from api, however when you format it back out, it doesn't look like you're handling it

if value['visualization_type'] == 'milestone':
is_milestone = True

the format method doesn't addend the visualization_type regardless of the valule

@jhu321
Copy link
Author

jhu321 commented Nov 2, 2022

i believe this is what needs to happen...

def _format(self):
try:
from_date = datetime.strftime(self.value.from_date,DATE_FORMAT)
to_date = datetime.strftime(self.value.to_date,DATE_FORMAT)

        if from_date > to_date :
            raise ColumnValueError(
                'invalid_timeline_dates',
                self.id,
                'Timeline from date cannot be after timeline to date.'
            )
        if from_date and to_date and self.value._is_milestone==False:
            return {
                'from': from_date,
                'to' : to_date
            }
        if from_date and to_date and self.value._is_milestone==True:
            return {
                'from': from_date,
                'to' : to_date,
                'visualization_type': 'milestone'
            }

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