mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix date test (#9811)
This commit is contained in:
parent
799aaf720a
commit
e46814ba05
@ -48,7 +48,7 @@ describe("DateMath", () => {
|
||||
|
||||
it("now/d on a utc dashboard should be start of the current day in UTC time", () => {
|
||||
var today = new Date();
|
||||
var expected = new Date(Date.UTC(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0));
|
||||
var expected = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate(), 0, 0, 0, 0));
|
||||
|
||||
var startOfDay = dateMath.parse('now/d', false, 'utc').valueOf();
|
||||
expect(startOfDay).toBe(expected.getTime());
|
||||
|
@ -114,7 +114,7 @@ describe('date time formats', function() {
|
||||
|
||||
it('should format as US date', function() {
|
||||
var str = kbn.valueFormats.dateTimeAsUS(1505634997920, 1);
|
||||
expect(str).toBe(moment(1505634997920).format('MM/DD/YYYY H:mm:ss a'));
|
||||
expect(str).toBe(moment(1505634997920).format('MM/DD/YYYY h:mm:ss a'));
|
||||
});
|
||||
|
||||
it('should format as US date and skip date when today', function() {
|
||||
|
Loading…
Reference in New Issue
Block a user