Skip to content

Commit

Permalink
Added 'getDate' to documentation.
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
  • Loading branch information
Johannestegner committed Jan 21, 2024
1 parent 6cddad7 commit dcc659e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ composer require personnummer/personnummer
| valid | string personnummer, [ array options<sup>[*](#options)</sup> ] | bool |

#### Instance
| Method | Arguments | Returns |
|----------------------|:----------------|--------:|
| format | bool longFormat | string |
| getAge | none | int |
| isMale | none | bool |
| isFemale | none | bool |
| isCoordinationNumber | none | bool |
| isInterimNumber | none | bool |
| Method | Arguments | Returns |
|----------------------|:----------------|---------:|
| format | bool longFormat | string |
| getAge | none | int |
| isMale | none | bool |
| isFemale | none | bool |
| isCoordinationNumber | none | bool |
| isInterimNumber | none | bool |
| getDate | none | DateTime |

| Property | Type | Description |
| ---------|:-------|----------------------------:|
Expand All @@ -43,7 +44,7 @@ When a personnummer is invalid a PersonnummerException is thrown.
| Option | Type | Default | Description |
|-------------------------|:-----|:--------|:---------------------------:|
| allowCoordinationNumber | bool | true | Accept coordination numbers |
| allowInterimNumber | bool | false | Accept interim/T numbers |
| allowInterimNumber | bool | false | Accept interim/T numbers |

## Examples

Expand Down
2 changes: 1 addition & 1 deletion src/Personnummer.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function getDate(): DateTime
{
return DateTime::createFromFormat(
'Ymd',
$this->parts['fullYear'] .$this->parts['month'] . $this->parts['realDay']
$this->parts['fullYear'] . $this->parts['month'] . $this->parts['realDay']
);
}

Expand Down

0 comments on commit dcc659e

Please sign in to comment.