Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
6d28421c
Commit
6d28421c
authored
Jul 08, 2019
by
Lars Ingebrigtsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get time zones right
parent
babd5b8b
Pipeline
#2295
failed with stage
in 80 minutes and 35 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
lisp/calendar/iso8601.el
lisp/calendar/iso8601.el
+6
-6
test/lisp/calendar/iso8601-tests.el
test/lisp/calendar/iso8601-tests.el
+7
-1
No files found.
lisp/calendar/iso8601.el
View file @
6d28421c
...
...
@@ -174,15 +174,15 @@ well as variants like \"2008W32\" (week number) and
Return the number of minutes."
(
if
(
not
(
iso8601--match
iso8601--zone-match
string
))
(
signal
'wrong-type-argument
string
)
(
if
(
match-string
1
string
)
(
if
(
match-string
2
string
)
;; HH:MM-ish.
(
let
((
hour
(
string-to-number
(
match-string
3
string
)))
(
minute
(
and
(
match-string
4
string
)
(
string-to-number
(
match-string
5
string
)))))
(
+
(
*
(
if
(
equal
(
match-string
1
string
)
"-"
)
(
-
hour
)
hour
)
60
(
string-to-number
(
match-string
4
string
)))))
(
*
(
if
(
equal
(
match-string
2
string
)
"-"
)
-1
1
)
(
+
(
*
hour
60
)
(
or
minute
0
))))
;; "Z".
0
)))
...
...
test/lisp/calendar/iso8601-tests.el
View file @
6d28421c
...
...
@@ -66,7 +66,13 @@
(
ert-deftest
test-iso8601-combined
()
(
should
(
equal
(
iso8601-parse
"2008-03-02T13:47:30"
)
'
(
30
47
13
2
3
2008
nil
nil
nil
))))
'
(
30
47
13
2
3
2008
nil
nil
nil
)))
(
should
(
equal
(
iso8601-parse
"2008-03-02T13:47:30Z"
)
'
(
30
47
13
2
3
2008
nil
nil
0
)))
(
should
(
equal
(
iso8601-parse
"2008-03-02T13:47:30+01:00"
)
'
(
30
47
13
2
3
2008
nil
nil
3600
)))
(
should
(
equal
(
iso8601-parse
"2008-03-02T13:47:30-01"
)
'
(
30
47
13
2
3
2008
nil
nil
-3600
))))
(
ert-deftest
test-iso8601-duration
()
(
should
(
equal
(
iso8601-parse-duration
"P3Y6M4DT12H30M5S"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment