# AppSettings

**Kind:** Class

**Source:** `Frontend/src/app/settings/app/app.settings.ts` (line 241)

**Part of:** [Frontend](subsystem-frontend-src-app)

`AppSettings` groups application settings helpers for origin URL access, forbidden-character validation, and date handling. It is used by frontend code that needs consistent date values for data-grid filters and time-zone adjustments.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `getOriginUrl` | `getOriginUrl()` | `void` |
| `ifForbiddenCharacters` | `ifForbiddenCharacters(filterObject: any)` | `boolean` |
| `checkingForForbiddenCharacters` | `checkingForForbiddenCharacters(filterObject: any)` | `boolean` |
| `adjustDateForDataGridFilterIsDateColumn` | `adjustDateForDataGridFilterIsDateColumn(date: Date)` | `void` |
| `checkIfDataGridFilterIsDateColumn` | `checkIfDataGridFilterIsDateColumn(filterObject: any, gridInstance: any)` | `any` |
| `normalizeDate` | `normalizeDate(dateString: string)` | `Date` |
| `addTimeZoneToDate` | `addTimeZoneToDate(date: Date)` | `void` |
| `addTimeZoneToDateEnhanced` | `addTimeZoneToDateEnhanced(date: Date)` | `string` |
| `subtractTimeZoneToDate` | `subtractTimeZoneToDate(date: Date)` | `void` |
| `subtractTimeZoneToDateEnhanced` | `subtractTimeZoneToDateEnhanced(date: Date)` | `void` |
| `isMeDeveloper` | `isMeDeveloper()` | `boolean` |
| `ifShotecCompany` | `ifShotecCompany()` | `void` |
| `if_ShotecSAE_ServiceCenter_Branches` | `if_ShotecSAE_ServiceCenter_Branches(BranchId: undefined)` | `boolean` |
| `leavePage` | `leavePage()` | `void` |
| `CalculateSize` | `CalculateSize(offset: number)` | `void` |
| `setYearsColorForDashboard` | `setYearsColorForDashboard(year: number)` | `string` |
| `GetPrecentage` | `GetPrecentage(val: undefined, total_val: undefined)` | `void` |
| `getUserSignature` | `getUserSignature(BranchLogo: undefined)` | `string` |
| `checkEquality` | `checkEquality(source: any, target: any, pro: string, CalculatedFields: any[])` | `boolean` |
| `DataChanged` | `DataChanged(source: any, target: any, CalculatedFields: any[])` | `boolean` |
| `calculateMonthsBeforeToday` | `calculateMonthsBeforeToday(year: number, monthIndex: number)` | `number` |
| `formatDate` | `formatDate(e: Date)` | `void` |
| `formatDateTime` | `formatDateTime(e: Date)` | `void` |
| `ConvertDateToString` | `ConvertDateToString(dateX: Date)` | `string` |
| `ConvertDateToStringEU` | `ConvertDateToStringEU(dateX: Date)` | `string` |
| `ConvertStringToDate` | `ConvertStringToDate(data: string)` | `Date` |
| `ConvertStringToDateEU` | `ConvertStringToDateEU(data: string)` | `Date` |
| `NumeralConversionDefault` | `NumeralConversionDefault(data: undefined, format: undefined)` | `string` |
| `NumeralConversionForRate` | `NumeralConversionForRate(data: undefined, format: undefined)` | `string` |
| `NumeralConversion` | `NumeralConversion(data: undefined, format: undefined, currency: undefined)` | `string` |
| `NumeralUnConversion` | `NumeralUnConversion(data: undefined)` | `number` |
| `returnDecimalDigits` | `returnDecimalDigits(numOfDigits: number)` | `string` |
| `getDecimalDigits` | `getDecimalDigits(value: number)` | `string` |
| `convertHtmlToText` | `convertHtmlToText(html: string)` | `string` |
| `ParseError` | `ParseError(error: any)` | `string` |
| `UlitizeTime` | `UlitizeTime(i: number, Sperator: string, title: string)` | `void` |
| `calculateTimePeriod` | `calculateTimePeriod(periodId: number)` | `number` |
| `returnTimePeriodForMoment` | `returnTimePeriodForMoment(periodId: number)` | `string` |
| `setCookie` | `setCookie(cName: undefined, cValue: undefined, expDays: undefined)` | `void` |
| `getCookie` | `getCookie(cName: undefined)` | `void` |
| `deleteCookie` | `deleteCookie(cName: string)` | `void` |
| `saveLocalStorage` | `saveLocalStorage()` | `void` |
| `ifSavePamsStorage` | `ifSavePamsStorage()` | `boolean` |
| `ifSaveUserLoggedInStorage` | `ifSaveUserLoggedInStorage()` | `boolean` |
| `readPamsLocalStorage` | `readPamsLocalStorage()` | `void` |
| `readUserLoggedInLocalStorage` | `readUserLoggedInLocalStorage()` | `void` |
| `clearLocalStorage` | `clearLocalStorage()` | `void` |
| `ifStorageUpdated` | `ifStorageUpdated()` | `boolean` |
| `initializeGridDefaults` | `initializeGridDefaults()` | `void` |
| `save2WayAuthenticationLocalStorage` | `save2WayAuthenticationLocalStorage()` | `void` |

## Properties

| Property | Type |
|---|---|
| `APIUrl` | `any` |
| `APIOneDriveUrl` | `any` |
| `OriginFrontURL` | `any` |
| `sendMailMSALDirection` | `any` |
| `AppVersionNumber` | `any` |
| `AppVersion` | `any` |
| `BuildHash` | `any` |
| `AppName` | `any` |
| `PoweredByCompany` | `any` |
| `bottomActionBar` | `any` |
| `ImgPath` | `any` |
| `MainPageRoute` | `any` |
| `API_ProjectProcessWorkflowTypeController` | `any` |
| `API_CategoryController` | `any` |
| `API_ProductController` | `any` |
| `API_ProductVariantController` | `any` |
| `API_ProductSubSupplierController` | `any` |
| `API_AuthController` | `any` |
| `API_UnitController` | `any` |
| `API_CountryController` | `any` |
| `API_Activities` | `any` |
| `API_ActivitiesLookups` | `any` |
| `API_CompanyCurrencyController` | `any` |
| `API_OfferController` | `any` |
| `API_OfferItemController` | `any` |
| `API_ItemController` | `any` |
| `API_TimePeriodController` | `any` |
| `API_NewTimePeriod` | `any` |
| `API_OfferMileStoneController` | `any` |
| `API_OfferItemVersionController` | `any` |
| `API_InquiryController` | `any` |
| `API_GuaranteeTypeController` | `any` |
| `API_JobGuaranteeController` | `any` |
| `API_CurrencyController` | `any` |
| `API_ContactInfoTypesController` | `any` |
| `API_ContactInfoRelatedTypeController` | `any` |
| `API_JobProcessController` | `any` |
| `API_JobItemController` | `any` |
| `API_JobVersionController` | `any` |
| `API_CityController` | `any` |
| `API_GovernateController` | `any` |
| `API_SerialStatusController` | `any` |
| `API_SerialCombinationsController` | `any` |
| `API_SerialComponentsController` | `any` |
| `API_SerialTypeController` | `any` |
| `API_PaymentMethodController` | `any` |
| `API_DeliveryTermController` | `any` |
| `API_ClientsController` | `any` |
| `API_PersonController` | `any` |
| `API_ClientTypesController` | `any` |

## Where it refuses work

- `AppSettings` stops the work with an early return when `!filterObject`, in 2 places.
- `AppSettings` stops the work with an early return when `AppSettings.checkingForForbiddenCharacters(item)`.
- `AppSettings` stops the work with an early return when `this.checkingForForbiddenCharacters(filterObject)`.
- `AppSettings` stops the work with an early return when `filterObjectAsString.includes(char)`.
- `AppSettings` stops the work with an early return when `Array.isArray(filterObject)`.
- `AppSettings` stops the work with an early return when `item.columnIndex !== undefined && gridInstance`.

## When something fails

- `AppSettings` handles failure in 3 places: it logs it and continues in all 3.

## Diagram

```mermaid
graph LR
  AppSettings --> Origin[getOriginUrl]
  AppSettings --> Validation[ifForbiddenCharacters]
  AppSettings --> ValidationCheck[checkingForForbiddenCharacters]
  AppSettings --> GridDate[adjustDateForDataGridFilterIsDateColumn]
  GridDate --> DateColumn[checkIfDataGridFilterIsDateColumn]
  AppSettings --> DateNormalization[normalizeDate]
  AppSettings --> TimeZone[addTimeZoneToDate]
  TimeZone --> EnhancedAdd[addTimeZoneToDateEnhanced]
  AppSettings --> TimeZoneSubtract[subtractTimeZoneToDate]
  TimeZoneSubtract --> EnhancedSubtract[subtractTimeZoneToDateEnhanced]
```

## Usage

```ts
import { AppSettings } from './app.settings';

const appSettings = new AppSettings();

const originUrl = appSettings.getOriginUrl();
const hasForbiddenCharacters = appSettings.ifForbiddenCharacters();

const normalizedDate: Date = appSettings.normalizeDate();
const dateWithTimeZone = appSettings.addTimeZoneToDateEnhanced();

if (!hasForbiddenCharacters) {
  appSettings.adjustDateForDataGridFilterIsDateColumn();
}

console.log({ originUrl, normalizedDate, dateWithTimeZone });
```

## AI Coding Instructions

- Keep date conversion logic inside `AppSettings` so data-grid filters use the same date handling path.
- Check forbidden-character methods before sending user-entered values to API or filter code.
- Use `normalizeDate()` when a caller requires a `Date` value.
- Use the enhanced time-zone methods when the caller requires a string result.
- Verify date-column detection through `checkIfDataGridFilterIsDateColumn()` before applying data-grid date adjustments.

## Relationships

- CALLS → `FilesController`
- CALLS → `MarketSegmentController`
- CALLS → `CategoryController`
- CALLS → `ProductController`
- CALLS → `ProductVariantController`
- CALLS → `ProductSupplierController`
- CALLS → `UnitController`
- CALLS → `CountryController`
- CALLS → `ActivitiesController`
- CALLS → `VisitPurposeController`
- CALLS → `CompanyCurrencyController`
- CALLS → `OfferController`
- CALLS → `ItemController`
- CALLS → `TimePeriodController`
- CALLS → `SalesJobController`
- CALLS → `OfferMileStoneController`
- CALLS → `InquiryController`
- CALLS → `GuaranteeTypesController`
- CALLS → `JobGuaranteesController`
- CALLS → `CurrencyController`
- CALLS → `ContactInfoTypeController`
- CALLS → `ContactInfoRelatedTypeController`
- CALLS → `JobProcessController`
- CALLS → `JobItemController`
- CALLS → `JobVersionController`
- CALLS → `CityController`
- CALLS → `GovernateController`
- CALLS → `SerialStatusController`
- CALLS → `SerialCombinationsController`
- CALLS → `SerialComponentsController`
- CALLS → `SerialTypeController`
- CALLS → `PaymentMethodController`
- CALLS → `DeliveryTermController`
- CALLS → `PersonController`
- CALLS → `ClientTypeController`
- CALLS → `SupplierTypeController`
- CALLS → `PersonEmailController`
- CALLS → `PersonPhoneController`
- CALLS → `CompanyBranchContactInfoController`
- CALLS → `ContactInfoController`
- CALLS → `CompanyBranchController`
- CALLS → `StoreController`
- CALLS → `StoreAreaController`
- CALLS → `WarehouseModelController`
- CALLS → `ReceivingShipmentController`
- CALLS → `InspectionSheetController`
- CALLS → `InspectionBaseController`
- CALLS → `TransferOrderReasonController`
- CALLS → `ExternalServiceTypeController`
- CALLS → `ProductWithdrawalController`
- CALLS → `BookingProductController`
- CALLS → `StoreProductController`
- CALLS → `ShippingOrderController`
- CALLS → `ProductionOrderController`
- CALLS → `IssuingGoodsController`
- CALLS → `ReturnNoteController`
- CALLS → `DeliveryNoteController`
- CALLS → `ExternalServiceController`
- CALLS → `TransferOrderController`
- CALLS → `BankController`
- CALLS → `BankAccountController`
- CALLS → `CompanyController`
- CALLS → `AddressController`
- CALLS → `AddressTypeController`
- CALLS → `CompanyBranchSettingController`
- CALLS → `ProcessReasonController`
- CALLS → `InquiryTypesController`
- CALLS → `OfferStatusController`
- CALLS → `OrderChanceController`
- CALLS → `OrderStatusController`
- CALLS → `JobListLayoutController`
- CALLS → `DefaultJobListLayoutController`
- CALLS → `ProductTypeController`
- CALLS → `MRQProductTypeController`
- CALLS → `BookingTargetController`
- CALLS → `ForecastedBookingController`
- CALLS → `TeamTargetController`
- CALLS → `PrincipalTargetController`
- CALLS → `AccountManagerTargetController`
- CALLS → `ProductTypeTargetController`
- CALLS → `FinanceBudgetController`
- CALLS → `ProductTypeGroupController`
- CALLS → `NationalityController`
- CALLS → `EmployeeTypesController`
- CALLS → `MaritalStatusController`
- CALLS → `CompanyBranchDepartmentController`
- CALLS → `ProjectCommentController`
- CALLS → `ProjectRegisteredController`
- CALLS → `ShareholdersController`
- CALLS → `ContactPersonController`
- CALLS → `ContactPersonReferenceController`
- CALLS → `ContactPersonRelatedTypeController`
- CALLS → `RegistrationStatusController`
- CALLS → `DataSourceController`
- CALLS → `DashboardController`
- CALLS → `DashboardDataController`
- CALLS → `OrderActivationConditionController`
- CALLS → `MyDeskController`
- CALLS → `ReactivationReasonsController`
- CALLS → `DefaultSerialStatusController`
- CALLS → `ConnectionTypeController`
- CALLS → `MailToController`
- CALLS → `NotificationController`
- CALLS → `NotificationTypeController`
- CALLS → `ReminderController`
- CALLS → `SytemNotificationController`
- CALLS → `SentEmailsController`
- CALLS → `TimeUnitTypeController`
- CALLS → `UserEmailSettingController`
- CALLS → `AssigneeController`
- CALLS → `AssigneeAccessTypeController`
- CALLS → `PriorityController`
- CALLS → `StatusController`
- CALLS → `TaskController`
- CALLS → `CommentsController`
- CALLS → `FileCategoryController`
- CALLS → `RelatedToTypesController`
- CALLS → `TagsController`
- CALLS → `ClientDelayController`
- CALLS → `DashboardWidgetController`
- CALLS → `AccountsController`
- CALLS → `ProductCategoryController`
- CALLS → `PersonUserController`
- CALLS → `RoleController`
- CALLS → `PersonTypeController`
- CALLS → `PermissionController`
- CALLS → `RolePermissionsController`
- CALLS → `JobVersionStatusLogController`
- CALLS → `JobItemStatusController`
- CALLS → `JobItemStatusDataController`
- CALLS → `ProjectController`
- CALLS → `ProjectStatusController`
- CALLS → `JobDocumentController`
- CALLS → `InvoiceController`
- CALLS → `UpcomingInvoiceController`
- CALLS → `PaymentController`
- CALLS → `ImportController`
- CALLS → `LetterOfGuaranteeController`
- CALLS → `PmSerialCombinationController`
- CALLS → `BillOfMaterialController`
- CALLS → `MaterialsRequisitionController`
- CALLS → `MRQJobController`
- CALLS → `MRQJobInquiryController`
- CALLS → `MRQJobOfferController`
- CALLS → `MRQJobOrderController`
- CALLS → `MRQJobProductController`
- CALLS → `SalesPotentialController`
- CALLS → `SalesFollowerController`
- CALLS → `SalesPotentialStatusController`
- CALLS → `SalesOfferController`
- CALLS → `SalesOrderController`
- CALLS → `SalesItemController`
- CALLS → `CustomFieldController`
- CALLS → `PrincipalInvoicePaymentController`
- CALLS → `PrincipalPaymentController`
- CALLS → `PrincipalDeductionController`
- CALLS → `UpcomingPrincipalInvoiceController`
- CALLS → `PurchasingJobController`
- CALLS → `purchasingInquiryController`
- CALLS → `PurchasingOfferController`
- CALLS → `PurchasingOrderController`
- CALLS → `PurchasingItemController`
- CALLS → `PurchasePaymentMilestoneController`
- CALLS → `PmPaymentMilestoneController`
- CALLS → `WordTemplateController`
- CALLS → `AuditController`
- CALLS → `ColorMarkerController`
- CALLS → `ClientProfileController`
- CALLS → `CustomerSurveyController`
- CALLS → `ReferenceListController`
- CALLS → `CostCalculationController`
- CALLS → `SalesJobCostController`

## Used by

554 references from 554 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (554)

- `AppRoutingModule` — `Frontend/src/app/app-routing.module.ts`:1
- `AppComponent` — `Frontend/src/app/app.component.ts`:1
- `TranslateHandler` — `Frontend/src/app/app.module.ts`:1
- `MrqDetailsComponent` — `Frontend/src/app/components/MRQ/mrq-details/mrq-details.component.ts`:1
- `MrqInquiryComponent` — `Frontend/src/app/components/MRQ/mrq-details/mrq-inquiry/mrq-inquiry.component.ts`:1
- `MrqListComponent` — `Frontend/src/app/components/MRQ/mrq-list/mrq-list.component.ts`:1
- `MrqService` — `Frontend/src/app/components/MRQ/mrq.service.ts`:1
- `BillOfMaterialsDetailsComponent` — `Frontend/src/app/components/bill-of-materials/bill-of-materials-details/bill-of-materials-details.component.ts`:1

…and 546 more.
