# Data

Precisa solicitar uma data para o usuário? Com essa mascara você pode.

Para configurar, acesse a aba input e em seguida selecione a opção Data no ícone `?`

![](/files/34qnRYsfLZJzu3RMi1bW)

### Estrutura

```json
{
    "default": {
        "type": "date",
        "payload": {
            "allowInput": false
        }
    }
}
```

#### Atributos

* **type:** date
* **payload:**
  * **max (opcional):** range de data máxima permitida (YYYY-MM-DD).
  * **min (opcional):** range de data mínima permitida (YYYY-MM-DD).
  * **default (opcional):** data que será setada no campo assim que o componente aparecer (YYYY-MM-DD).
  * **weekends (default: true):** se `false`, não aceitará data cujo dia esteja em um final de semana.
  * **allowInput (default: true):** se `false`, irá travar o `input` do usuário. Obs.: funcional apenas no Widget.

‌

Como visto acima, na especificação de Atributos, não há um que seja obrigatório. Portanto, mesmo que seja declarado um `payload` vazio, ainda ocorrerá uma validação, que decidirá se a data é válida ou não.

A validação do `input` que é passado para o builder possui um valor boolean (true ou false).

```
{
        "valid": true|false,
        "text": "Data digitada pelo usuário 'as is'",
        "value": "Data formatada no padrão ISO 8601: YYYY-MM-DD"
    }
```

### **Exemplo**

{% tabs %}
{% tab title="Exemplo" %}

```json
{
    "default": {
        "type": "date",
        "payload": {
            "max": "2020-12-31",
            "min": "2000-09-30",
            "default": "2020-12-31",
            "weekends": false,
            "allowInput": false
        }
    }
}
```

{% endtab %}

{% tab title="widget" %}
![](/files/-MJcDkgk1DEPAMyxd0yj)
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.altu.d1.cx/build/assistentes/builder/componentes/input/date.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
