Skip to content

Commit c7d84e4

Browse files
committed
Adding publishedAt() method to Story data class
1 parent ad61481 commit c7d84e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Data/Story.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,14 @@ public function name(): string
8989
return $this->getString('name');
9090
}
9191

92-
public function createdAt(): null|string
92+
public function createdAt(string $format = "Y-m-d"): null|string
9393
{
94-
return $this->getFormattedDateTime('created_at', "", format: "Y-m-d");
94+
return $this->getFormattedDateTime('created_at', "", format: $format);
95+
}
96+
97+
public function publishedAt(string $format = "Y-m-d"): null|string
98+
{
99+
return $this->getFormattedDateTime('published_at', "", format: $format);
95100
}
96101

97102
public function updatedAt(): null|string

0 commit comments

Comments
 (0)