Skip to content

Commit

Permalink
Merge branch 'release/1.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pculka committed Oct 15, 2023
2 parents bf14494 + b1849ac commit d819098
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "trexima/cv",
"description": "Bundle provides form for creating CV in european format.",
"type": "symfony-bundle",
"version": "1.5.4",
"version": "1.6.0",
"license": "MIT",
"authors": [
{
Expand Down
12 changes: 11 additions & 1 deletion src/Entity/EuropeanCV.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,18 @@ public function setDay(?int $day): self
return $this;
}

#[Assert\Date(message: 'trexima_european_cv.birth_date.constraint.valid_date')]
public function getBirthDate(): ?string
{
if (($year = $this->getYear()) && ($month = $this->getMonth()) && ($day = $this->getDay())) {
return $year . '-' . str_pad($month, 2, '0', STR_PAD_LEFT) . '-' . str_pad($day, 2, '0', STR_PAD_LEFT);
}

return null;
}

#[Assert\LessThanOrEqual('today', message: 'trexima_european_cv.birth_date.constraint.less_than_or_equal')]
public function getBirthDate(): ?\DateTimeImmutable
public function getBirthDateTime(): ?\DateTimeImmutable
{
if (($year = $this->getYear()) && ($month = $this->getMonth()) && ($day = $this->getDay())) {
return (new \DateTimeImmutable())->setDate($year, $month, $day)->setTime(0, 0);
Expand Down
2 changes: 1 addition & 1 deletion translations/trexima_european_cv+intl-icu.sk-SK.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@
<unit id="9ZJVNUx" name="trexima_european_cv.form_sub_label.additional_informations">
<segment>
<source>trexima_european_cv.form_sub_label.additional_informations</source>
<target>Prajete si ešte niečo doplniť? Napíšte to do tohto políčka</target>
<target>Praješ si ešte niečo doplniť? Napíš to do tohto políčka</target>
</segment>
</unit>
<unit id="KNfVUN0" name="trexima_european_cv.form_placeholder.additional_informations">
Expand Down
6 changes: 6 additions & 0 deletions translations/validators+intl-icu.sk-SK.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,11 @@
<target>Príď si urobiť životopis až po narodení &#x1f60a; Prosím, skontroluj dátum narodenia.</target>
</segment>
</unit>
<unit id="tXD_L.h" name="trexima_european_cv.birth_date.constraint.valid_date">
<segment>
<source>trexima_european_cv.birth_date.constraint.valid_date</source>
<target>Prosím, vyplň dátum narodenia v správnom tvare.</target>
</segment>
</unit>
</file>
</xliff>

0 comments on commit d819098

Please sign in to comment.