sitemap icon indicating copy to clipboard operation
sitemap copied to clipboard

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

Open ZhangChengLin opened this issue 4 years ago • 4 comments

https://github.com/samdark/sitemap/blob/17dc5602e817d7f16b03c476569fb38e2de48156/Sitemap.php#L259 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 avatar Jan 06 '21 15:01 ZhangChengLin

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

ZhangChengLin avatar Jan 06 '21 15:01 ZhangChengLin

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

samdark avatar Jan 11 '21 11:01 samdark

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?

ZhangChengLin avatar Jan 12 '21 00:01 ZhangChengLin

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?

samdark avatar Jan 12 '21 06:01 samdark