mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
07cb542b97
fixes https://github.com/TryGhost/Team/issues/1946 Problem: - When running the admin tests in a timezone that is later than UTC, the tests failed. Causes: - Some tests needed some adjustements - The DateTimePicker did not always use the correct timezone. - Test models createdAt times sometimes depended on the timezone of the test runner Solution: - All the input DateTimePicker gets should be processed in the blog's timezone. - Make sure that all communication (properties, setters, minDate...) with `PowerDatepicker` happens in the local timezone. When setting, convert that date to the blog timezone and use that as the real value.
16 lines
449 B
JavaScript
16 lines
449 B
JavaScript
import moment from 'moment-timezone';
|
|
import {Factory} from 'miragejs';
|
|
|
|
export default Factory.extend({
|
|
createdAt() { return moment.utc().toISOString(); },
|
|
createdBy: 1,
|
|
name(i) { return `Label ${i}`; },
|
|
slug(i) { return `label-${i}`; },
|
|
updatedAt() { return moment.utc().toISOString(); },
|
|
updatedBy: 1,
|
|
count() {
|
|
// this gets updated automatically by the label serializer
|
|
return {members: 0};
|
|
}
|
|
});
|