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

Commit

Permalink
Merge pull request #1131 from Yoast/P2-699-fix-date-selection-bug
Browse files Browse the repository at this point in the history
Use the set date instead of getDate()
  • Loading branch information
hansjovis authored Mar 30, 2021
2 parents e91c061 + 65f3c55 commit 5fe67a9
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 5fe67a9

Please sign in to comment.