> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# isValidDatePeriodLiteral()

- Package: [@gooddata/sdk-model](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/index.md)
- Kind: function
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.71/libs/sdk-model/src/base/datePeriodLiterals.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Tells whether the literal is one period in the format of the granularity.

**Signature:**

```typescript
export declare function isValidDatePeriodLiteral(granularity: DatePeriodGranularity | DateRangeParameterGranularity, literal: unknown): boolean;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| granularity | [DatePeriodGranularity](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.dateperiodgranularity/index.md) \| [DateRangeParameterGranularity](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.daterangeparametergranularity/index.md) |  |
| literal | unknown |  |

**Returns:**

boolean

## Remarks

A week is accepted up to the number of ISO-8601 weeks in its year, 52 or 53.

The granularities of a date range parameter are accepted too, in the formats described in [IDateRangeParameterPeriod](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.idaterangeparameterperiod/index.md). A day, hour, minute or second must exist in the calendar.
