-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add timestamp to export-filename #1078
Conversation
controllers/Opml.php
Outdated
@@ -343,7 +343,8 @@ public function export() { | |||
\F3::get('logger')->debug('finished OPML export'); | |||
|
|||
// save content as file and suggest file name | |||
header('Content-Disposition: attachment; filename="selfoss-subscriptions.xml"'); | |||
$export_name = "selfoss-subscriptions-" . date('YmdHis') . ".xml"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use the ISO format so that the date is more legible?
$export_name = "selfoss-subscriptions-" . date('YmdHis') . ".xml"; | |
$exportName = 'selfoss-subscriptions-' . date('Y-m-d\TH:i:s') . '.xml'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatted date is a problem, as ':' is not allowed in filenames. Will be replaced by '_' and looks weird. I would prefer keeping the raw timestamp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about Ymd\THi
? That should be at least little bit more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll change it, but keeping the seconds as well.
Ymd\THis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have decided to remove the T
after all. It just looks weird.
Thank you. |
To track the history of subscriptions, this adds a timestamp to the proposed export-filename.
selfoss-subscription.xml becomes selfoss-subscriptions-20190121160154.xml