Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
fix: fix time description
Browse files Browse the repository at this point in the history
  • Loading branch information
YCK1130 committed Aug 23, 2024
1 parent 19f86d8 commit d936cb5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
26 changes: 13 additions & 13 deletions application/jira/v0/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ Get a sprint in Jira
| Self (optional) | `self` | string | The URL of the sprint |
| State (optional) | `state` | string | The state of the sprint, can be: `active`, `closed`, `future` |
| Name (optional) | `name` | string | The name of the sprint |
| Start Date (optional) | `start-date` | string | The start date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| End Date (optional) | `end-date` | string | The end date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| Complete Date (optional) | `complete-date` | string | The complete date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| Start Date (optional) | `start-date` | string | The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| End Date (optional) | `end-date` | string | The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| Complete Date (optional) | `complete-date` | string | The complete date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| Origin Board ID (optional) | `origin-board-id` | integer | The ID of the origin board |
| Goal (optional) | `goal` | string | The Goal of the sprint |

Expand Down Expand Up @@ -259,8 +259,8 @@ Create a sprint in Jira
| Board Name (required) | `board-name` | string | The name of the board |
| Name (required) | `name` | string | The name of the sprint |
| Goal (required) | `goal` | string | The goal of the sprint |
| Start Date (required) | `start-date` | string | The start date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| End Date (required) | `end-date` | string | The end date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| Start Date (required) | `start-date` | string | The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| End Date (required) | `end-date` | string | The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |



Expand All @@ -270,9 +270,9 @@ Create a sprint in Jira
| Self | `self` | string | The URL of the sprint |
| State (optional) | `state` | string | The state of the sprint, can be: `active`, `closed`, `future` |
| Name (optional) | `name` | string | The name of the sprint |
| Start Date (optional) | `start-date` | string | The start date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| End Date (optional) | `end-date` | string | The end date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| Complete Date (optional) | `complete-date` | string | The complete date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| Start Date (optional) | `start-date` | string | The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| End Date (optional) | `end-date` | string | The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| Complete Date (optional) | `complete-date` | string | The complete date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| Origin Board ID (optional) | `origin-board-id` | integer | The ID of the origin board |
| Goal (optional) | `goal` | string | The Goal of the sprint |

Expand All @@ -292,8 +292,8 @@ Update a sprint in Jira
| Sprint ID (required) | `sprint-id` | integer | The ID of the sprint |
| Name (required) | `name` | string | The name of the sprint |
| Goal | `goal` | string | The goal of the sprint |
| Start Date (required) | `start-date` | string | The start date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| End Date (required) | `end-date` | string | The end date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| Start Date (required) | `start-date` | string | The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| End Date (required) | `end-date` | string | The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| Current State (required) | `current-state` | string | The current state of the sprint, can be: `future`, `active`, `closed` |
| Enter Next State | `enter-next-state` | boolean | Whether to enter the next state. If `true`, the sprint will enter the next state, i.e., `future` -> `active` -> `closed` |

Expand All @@ -305,9 +305,9 @@ Update a sprint in Jira
| Self | `self` | string | The URL of the sprint |
| State (optional) | `state` | string | The state of the sprint, can be: `active`, `closed`, `future` |
| Name (optional) | `name` | string | The name of the sprint |
| Start Date (optional) | `start-date` | string | The start date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| End Date (optional) | `end-date` | string | The end date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| Complete Date (optional) | `complete-date` | string | The complete date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z |
| Start Date (optional) | `start-date` | string | The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| End Date (optional) | `end-date` | string | The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| Complete Date (optional) | `complete-date` | string | The complete date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000` |
| Origin Board ID (optional) | `origin-board-id` | integer | The ID of the origin board |
| Goal (optional) | `goal` | string | The Goal of the sprint |

Expand Down
14 changes: 7 additions & 7 deletions application/jira/v0/config/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,21 @@
},
"start-date": {
"title": "Start Date",
"description": "The start date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z",
"description": "The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`",
"type": "string",
"instillUIOrder": 4,
"instillFormat": "string"
},
"end-date": {
"title": "End Date",
"description": "The end date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z",
"description": "The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`",
"type": "string",
"instillUIOrder": 5,
"instillFormat": "string"
},
"complete-date": {
"title": "Complete Date",
"description": "The complete date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z",
"description": "The complete date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`",
"type": "string",
"instillUIOrder": 6,
"instillFormat": "string"
Expand Down Expand Up @@ -1232,7 +1232,7 @@
},
"start-date": {
"title": "Start Date",
"description": "The start date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z",
"description": "The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`",
"instillShortDescription": "The start date of the sprint",
"instillUIOrder": 3,
"instillFormat": "string",
Expand All @@ -1248,7 +1248,7 @@
},
"end-date": {
"title": "End Date",
"description": "The end date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z",
"description": "The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`",
"instillShortDescription": "The end date of the sprint",
"instillUIOrder": 4,
"instillFormat": "string",
Expand Down Expand Up @@ -1347,7 +1347,7 @@
},
"start-date": {
"title": "Start Date",
"description": "The start date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z",
"description": "The start date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`",
"instillShortDescription": "The start date of the sprint",
"instillUIOrder": 3,
"instillFormat": "string",
Expand All @@ -1363,7 +1363,7 @@
},
"end-date": {
"title": "End Date",
"description": "The end date of the sprint. In the RFC3339 format, e.g. 2018-03-05T00:00:00Z",
"description": "The end date of the sprint, e.g. 2018-03-05 (default 00:00 UTC+0). To adjust your time zone, please provide a more detailed RFC3339 format like `2018-03-05T09:00:00Z0000`",
"instillShortDescription": "The end date of the sprint",
"instillUIOrder": 4,
"instillFormat": "string",
Expand Down
8 changes: 8 additions & 0 deletions application/jira/v0/sprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ func (jiraClient *Client) createSprintTask(ctx context.Context, props *structpb.
if _, err := time.Parse(time.RFC3339, opt.StartDate); err != nil {
if opt.StartDate == "" {
opt.StartDate = time.Now().Format(time.RFC3339)
} else if _, err := time.Parse(time.RFC3339, opt.StartDate+"T00:00:00Z"); err == nil {
opt.StartDate = opt.StartDate + "T00:00:00.000Z"
} else {
return nil, errmsg.AddMessage(
err,
Expand All @@ -192,6 +194,8 @@ func (jiraClient *Client) createSprintTask(ctx context.Context, props *structpb.
fmt.Errorf("end date is required"),
"end date is required",
)
} else if _, err := time.Parse(time.RFC3339, opt.EndDate+"T00:00:00Z"); err == nil {
opt.EndDate = opt.EndDate + "T00:00:00.000Z"
} else {
return nil, errmsg.AddMessage(
err,
Expand Down Expand Up @@ -310,6 +314,8 @@ func (jiraClient *Client) updateSprintTask(ctx context.Context, props *structpb.
if _, err := time.Parse(time.RFC3339, body.StartDate); err != nil {
if body.StartDate == "" {
body.StartDate = time.Now().Format(time.RFC3339)
} else if _, err := time.Parse(time.RFC3339, body.StartDate+"T00:00:00Z"); err == nil {
body.StartDate = body.StartDate + "T00:00:00.000Z"
} else {
return nil, errmsg.AddMessage(
err,
Expand All @@ -323,6 +329,8 @@ func (jiraClient *Client) updateSprintTask(ctx context.Context, props *structpb.
fmt.Errorf("end date is required"),
"end date is required",
)
} else if _, err := time.Parse(time.RFC3339, body.EndDate+"T00:00:00Z"); err == nil {
body.EndDate = body.EndDate + "T00:00:00.000Z"
} else {
return nil, errmsg.AddMessage(
err,
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Expand Down

0 comments on commit d936cb5

Please sign in to comment.