Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bahn-api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janne Mareike Koschinski
bahn-api
Commits
46f25881
Verified
Commit
46f25881
authored
6 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
Fix time format for coach sequence API
parent
eeec5901
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
client.go
+1
-1
1 addition, 1 deletion
client.go
types_util.go
+36
-0
36 additions, 0 deletions
types_util.go
with
37 additions
and
1 deletion
client.go
+
1
−
1
View file @
46f25881
...
...
@@ -290,7 +290,7 @@ func (c *ApiClient) CoachSequence(line string, date time.Time) (CoachSequence, e
func
(
c
*
ApiClient
)
loadCoachSequence
(
line
string
,
date
time
.
Time
)
(
CoachSequence
,
error
)
{
var
err
error
uri
:=
fmt
.
Sprintf
(
"%s/%s/%s"
,
c
.
CoachSequenceBaseUrl
,
line
,
date
.
Format
(
TimeLayoutShort
))
uri
:=
fmt
.
Sprintf
(
"%s/%s/%s"
,
c
.
CoachSequenceBaseUrl
,
line
,
date
.
Format
(
TimeLayout
Medium
Short
))
glog
.
Infof
(
"Loading CoachSequence %s %s"
,
line
,
date
.
Format
(
time
.
RFC3339
))
var
coachSequence
CoachSequence
...
...
This diff is collapsed.
Click to expand it.
types_util.go
+
36
−
0
View file @
46f25881
...
...
@@ -105,6 +105,42 @@ func (t *timeShort) Value() *time.Time {
}
}
type
timeMediumShort
struct
{
time
.
Time
}
const
TimeLayoutMediumShort
=
"200601021504"
func
(
t
*
timeMediumShort
)
MarshalXMLAttr
(
name
xml
.
Name
)
(
xml
.
Attr
,
error
)
{
if
t
==
nil
||
t
.
IsZero
()
{
return
xml
.
Attr
{},
nil
}
else
{
return
xml
.
Attr
{
Name
:
name
,
Value
:
t
.
Format
(
TimeLayoutMediumShort
),
},
nil
}
}
func
(
t
*
timeMediumShort
)
UnmarshalXMLAttr
(
attr
xml
.
Attr
)
error
{
if
attr
.
Value
!=
""
{
value
,
err
:=
time
.
Parse
(
TimeLayoutMediumShort
,
attr
.
Value
)
if
err
!=
nil
{
return
err
}
t
.
Time
=
value
}
return
nil
}
func
(
t
*
timeMediumShort
)
Value
()
*
time
.
Time
{
if
t
!=
nil
{
return
&
t
.
Time
}
else
{
return
nil
}
}
type
timeMedium
struct
{
time
.
Time
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment