Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Use the set date instead of getDate() #1131

Merged
merged 1 commit into from
Mar 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/schema-blocks/src/instructions/blocks/Date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { BlockConfiguration } from "@wordpress/blocks";
import { DateTimePicker, Dropdown } from "@wordpress/components";
import { createElement, useState } from "@wordpress/element";
import { __experimentalGetSettings, dateI18n, getDate, format } from "@wordpress/date";
import { __experimentalGetSettings, dateI18n, format } from "@wordpress/date";
import { __ } from "@wordpress/i18n";

// Internal imports.
Expand Down Expand Up @@ -36,7 +36,7 @@ export default class Date extends BlockInstruction {

let currentValue = __( "Select a date", "yoast-schema-blocks" );
if ( attributes[ this.options.name ] ) {
currentValue = format( "Y-m-d", getDate() );
currentValue = format( "Y-m-d", attributes[ this.options.name ] );
}

/**
Expand Down