add Class TimeZone

Signed-off-by: sunyaozu <sunyaozu@huawei.com>
This commit is contained in:
sunyaozu
2022-03-11 14:45:23 +08:00
parent 5a48adff74
commit 78f516e384
@@ -92,6 +92,11 @@ export function mockI18N() {
" may be different from that on a real device.")
return BreakIteratorMock;
},
getTimeZone: function(...args) {
console.warn("I18N.getTimeZone interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return TimeZoneMock;
},
Util: {
unitConvert: function(...args) {
console.warn("I18N.Util.unitConvert interface mocked in the Previewer. How this interface works on the Previewer" +
@@ -309,5 +314,27 @@ export function mockI18N() {
return paramMock.paramStringMock;
}
}
const TimeZoneMock = {
getID: function() {
console.warn("I18N.TimeZone.getID interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return paramMock.paramStringMock;
},
getDisplayName: function(...args) {
console.warn("I18N.TimeZone.getDisplayName interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return paramMock.paramStringMock;
},
getRawOffset: function() {
console.warn("I18N.TimeZone.getRawOffset interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return paramMock.paramNumberMock;
},
getOffset: function(...args) {
console.warn("I18N.TimeZone.getOffset interface mocked in the Previewer. How this interface works on the Previewer" +
" may be different from that on a real device.")
return paramMock.paramNumberMock;
}
}
return result;
}