Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lastmod requires the output format to be Y-m-d #71

Open
ZhangChengLin opened this issue Jan 6, 2021 · 4 comments
Open

lastmod requires the output format to be Y-m-d #71

ZhangChengLin opened this issue Jan 6, 2021 · 4 comments

Comments

@ZhangChengLin
Copy link

ZhangChengLin commented Jan 6, 2021

public function addItem($location, $lastModified = null, $changeFrequency = null, $priority = null)

https://github.com/samdark/sitemap/blob/master/Sitemap.php#L305
https://github.com/samdark/sitemap/blob/master/Sitemap.php#L354

Can the output format of the lastmod tag support Y-m-d
For example, if it is not an integer format parameter, let him use it directly as a string.

@ZhangChengLin
Copy link
Author

If $lastModified is not in integer format but in string format, there is no need to format it.

@samdark
Copy link
Owner

samdark commented Jan 11, 2021

Currently it assumes UNIX timestamp only but yeah, could be expanded to support cutom format. That adds a possibility to generate incorrect sitemap though...

@ZhangChengLin
Copy link
Author

Currently it assumes UNIX timestamp only but yeah, could be expanded to support cutom format. That adds a possibility to generate incorrect sitemap though...

Something wrong?
why?

@samdark
Copy link
Owner

samdark commented Jan 12, 2021

It is not wrong per se. Just need to add validation if you're going to accept strings as well. Want to make a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants