!203 add Class TimeZone

Merge pull request !203 from sunyaozu/OpenHarmony-3.1-Release
This commit is contained in:
openharmony_ci
2022-03-14 05:47:06 +00:00
committed by Gitee
@@ -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;
}