awa
This commit is contained in:
55
_internal/editor/esm/vs/base/common/date.js
Normal file
55
_internal/editor/esm/vs/base/common/date.js
Normal file
@@ -0,0 +1,55 @@
|
||||
import { Lazy } from './lazy.js';
|
||||
import { LANGUAGE_DEFAULT } from './platform.js';
|
||||
export const safeIntl = {
|
||||
DateTimeFormat(locales, options) {
|
||||
return new Lazy(() => {
|
||||
try {
|
||||
return new Intl.DateTimeFormat(locales, options);
|
||||
}
|
||||
catch {
|
||||
return new Intl.DateTimeFormat(undefined, options);
|
||||
}
|
||||
});
|
||||
},
|
||||
Collator(locales, options) {
|
||||
return new Lazy(() => {
|
||||
try {
|
||||
return new Intl.Collator(locales, options);
|
||||
}
|
||||
catch {
|
||||
return new Intl.Collator(undefined, options);
|
||||
}
|
||||
});
|
||||
},
|
||||
Segmenter(locales, options) {
|
||||
return new Lazy(() => {
|
||||
try {
|
||||
return new Intl.Segmenter(locales, options);
|
||||
}
|
||||
catch {
|
||||
return new Intl.Segmenter(undefined, options);
|
||||
}
|
||||
});
|
||||
},
|
||||
Locale(tag, options) {
|
||||
return new Lazy(() => {
|
||||
try {
|
||||
return new Intl.Locale(tag, options);
|
||||
}
|
||||
catch {
|
||||
return new Intl.Locale(LANGUAGE_DEFAULT, options);
|
||||
}
|
||||
});
|
||||
},
|
||||
NumberFormat(locales, options) {
|
||||
return new Lazy(() => {
|
||||
try {
|
||||
return new Intl.NumberFormat(locales, options);
|
||||
}
|
||||
catch {
|
||||
return new Intl.NumberFormat(undefined, options);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=date.js.map
|
||||
Reference in New Issue
Block a user