Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2751af68
Commit
2751af68
authored
Jan 18, 2019
by
Martin Wortschack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create UTC date
- Add tests for date column
parent
59feefb5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletion
+33
-1
ee/app/assets/javascripts/billings/components/subscription_table_row.vue
...avascripts/billings/components/subscription_table_row.vue
+4
-1
ee/changelogs/unreleased/8946-account-expiration-date-time-discrepancy.yml
...eleased/8946-account-expiration-date-time-discrepancy.yml
+5
-0
ee/spec/javascripts/billings/components/subscription_table_row_spec.js
...cripts/billings/components/subscription_table_row_spec.js
+24
-0
No files found.
ee/app/assets/javascripts/billings/components/subscription_table_row.vue
View file @
2751af68
...
@@ -33,7 +33,10 @@ export default {
...
@@ -33,7 +33,10 @@ export default {
},
},
getDisplayValue
(
col
)
{
getDisplayValue
(
col
)
{
if
(
col
.
isDate
&&
col
.
value
)
{
if
(
col
.
isDate
&&
col
.
value
)
{
return
dateInWords
(
new
Date
(
col
.
value
));
const
[
year
,
month
,
day
]
=
col
.
value
.
split
(
'
-
'
);
// create UTC date (prevent date from being converted to local timezone)
return
dateInWords
(
new
Date
(
year
,
month
-
1
,
day
));
}
}
// let's display '-' instead of 0 for the 'Free' plan
// let's display '-' instead of 0 for the 'Free' plan
...
...
ee/changelogs/unreleased/8946-account-expiration-date-time-discrepancy.yml
0 → 100644
View file @
2751af68
---
title
:
Create UTC date in subscription table
merge_request
:
9166
author
:
type
:
fixed
ee/spec/javascripts/billings/components/subscription_table_row_spec.js
View file @
2751af68
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
{
dateInWords
}
from
'
~/lib/utils/datetime_utility
'
;
import
component
from
'
ee/billings/components/subscription_table_row.vue
'
;
import
component
from
'
ee/billings/components/subscription_table_row.vue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
...
@@ -76,5 +77,28 @@ describe('Subscription Table Row', () => {
...
@@ -76,5 +77,28 @@ describe('Subscription Table Row', () => {
expect
(
currentCol
.
querySelector
(
'
.btn-help
'
)).
not
.
toBe
(
null
);
expect
(
currentCol
.
querySelector
(
'
.btn-help
'
)).
not
.
toBe
(
null
);
});
});
describe
(
'
date column
'
,
()
=>
{
const
dateColumn
=
{
id
:
'
c
'
,
label
:
'
Column C
'
,
value
:
'
2018-01-31
'
,
isDate
:
true
,
};
beforeEach
(()
=>
{
props
=
{
header
,
columns
:
[
dateColumn
]
};
vm
=
mountComponent
(
Component
,
props
);
});
it
(
'
should render the date in UTC
'
,
()
=>
{
const
currentCol
=
vm
.
$el
.
querySelectorAll
(
'
.grid-cell:not(.header-cell)
'
)[
0
];
const
d
=
dateColumn
.
value
.
split
(
'
-
'
);
const
outputDate
=
dateInWords
(
new
Date
(
d
[
0
],
d
[
1
]
-
1
,
d
[
2
]));
expect
(
currentCol
.
querySelector
(
'
.property-label
'
).
textContent
).
toContain
(
dateColumn
.
label
);
expect
(
currentCol
.
querySelector
(
'
.property-value
'
).
textContent
).
toContain
(
outputDate
);
});
});
});
});
});
});
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