# give/4.16.9/src/Framework/FieldsAPI/Date.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 45 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Framework/FieldsAPI/Date.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Framework/FieldsAPI/Date.php
- Modified: 2024-08-14T19:11:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.9/code/src/Framework/FieldsAPI/Date.php#L10-L20`.

```php
<?php

namespace Give\Framework\FieldsAPI;

/**
 * @since 3.0.0 add date format attribute
 * @since 2.32.0 added description
 * @since 2.12.0
 */
class Date extends Field
{
    use Concerns\HasEmailTag;
    use Concerns\HasHelpText;
    use Concerns\HasLabel;
    use Concerns\HasPlaceholder;
    use Concerns\HasDescription;

    const TYPE = 'date';

    /** @var string */
    protected $dateFormat = 'yyyy/mm/dd';

    /**
     * Set the date format for the element.
     *
     * @since 3.0.0
     */
    public function dateFormat(string $dateFormat): self
    {
        $this->dateFormat = $dateFormat;

        return $this;
    }

    /**
     * Get the date format for the element.
     *
     * @since 3.0.0
     */
    public function getDateFormat(): string
    {
        return $this->dateFormat;
    }
}

```
