@rolatech/angular-services 20.0.3 → 20.0.4-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3051,6 +3051,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImpor
3051
3051
  }]
3052
3052
  }] });
3053
3053
 
3054
+ class TimeZoneService {
3055
+ platformId = inject(PLATFORM_ID);
3056
+ isBrowser = isPlatformBrowser(this.platformId);
3057
+ http = inject(HttpClient);
3058
+ getBrowserTimeZone() {
3059
+ // Europe/London
3060
+ // Asia/Shanghai
3061
+ if (!this.isBrowser)
3062
+ return null; // SSR-safe
3063
+ return Intl.DateTimeFormat().resolvedOptions().timeZone ?? null;
3064
+ }
3065
+ /** minutes east of UTC (e.g. -420 for PDT) */
3066
+ getUtcOffsetMinutes() {
3067
+ if (!this.isBrowser)
3068
+ return null;
3069
+ return -new Date().getTimezoneOffset();
3070
+ }
3071
+ getTimeZoneFromApi() {
3072
+ // proxy /worldtime/api/ip
3073
+ return this.http.get(`/worldtime/api/ip`).pipe(map((r) => r.timezone));
3074
+ }
3075
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TimeZoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3076
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TimeZoneService, providedIn: 'root' });
3077
+ }
3078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TimeZoneService, decorators: [{
3079
+ type: Injectable,
3080
+ args: [{
3081
+ providedIn: 'root',
3082
+ }]
3083
+ }] });
3084
+
3054
3085
  class LoadingInterceptor {
3055
3086
  loadingService;
3056
3087
  activeRequests = 0;
@@ -3145,5 +3176,5 @@ function provideAngularServices() {
3145
3176
  * Generated bundle index. Do not edit.
3146
3177
  */
3147
3178
 
3148
- export { AmenityService, BackButtonDirective, BaseService, BookingService, BreadcrumbService, CartEventType, CartService, CategoryService, ConversationInitService, ConversationService, DialogComponent, DialogService, FacilityService, FeatureService, FulfillmentService, HideFooterDirective, InventoryService, LayoutService, LoadingInterceptor, LoadingService, MediaService, MembershipService, NavigationService, NotificationService, NotificationStore, NotificationTemplateService, OfferingService, OrderPayoutService, OrderService, PaymentService, PostService, ProductCategoryService, ProductService, PropertySearchService, PropertyService, ResourceCategoryService, ResourceService, SERVICE_DIRECTIVES, SidenavService, SnackBarService, SupportService, ThemeService, TitleService, provideAngularServices };
3179
+ export { AmenityService, BackButtonDirective, BaseService, BookingService, BreadcrumbService, CartEventType, CartService, CategoryService, ConversationInitService, ConversationService, DialogComponent, DialogService, FacilityService, FeatureService, FulfillmentService, HideFooterDirective, InventoryService, LayoutService, LoadingInterceptor, LoadingService, MediaService, MembershipService, NavigationService, NotificationService, NotificationStore, NotificationTemplateService, OfferingService, OrderPayoutService, OrderService, PaymentService, PostService, ProductCategoryService, ProductService, PropertySearchService, PropertyService, ResourceCategoryService, ResourceService, SERVICE_DIRECTIVES, SidenavService, SnackBarService, SupportService, ThemeService, TimeZoneService, TitleService, provideAngularServices };
3149
3180
  //# sourceMappingURL=rolatech-angular-services.mjs.map