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

Add timestamp to export-filename #1078

Merged
merged 1 commit into from
Jan 24, 2019
Merged

Add timestamp to export-filename #1078

merged 1 commit into from
Jan 24, 2019

Conversation

alfredbuehler
Copy link
Contributor

To track the history of subscriptions, this adds a timestamp to the proposed export-filename.

selfoss-subscription.xml becomes selfoss-subscriptions-20190121160154.xml

controllers/Opml.php Outdated Show resolved Hide resolved
@@ -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";
Copy link
Member

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?

Suggested change
$export_name = "selfoss-subscriptions-" . date('YmdHis') . ".xml";
$exportName = 'selfoss-subscriptions-' . date('Y-m-d\TH:i:s') . '.xml';

Copy link
Contributor Author

@alfredbuehler alfredbuehler Jan 21, 2019

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.

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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.

@jtojnar jtojnar merged commit d2f06dc into fossar:master Jan 24, 2019
@jtojnar
Copy link
Member

jtojnar commented Jan 24, 2019

Thank you.

@alfredbuehler alfredbuehler deleted the exportdate branch January 25, 2019 09:45
@jtojnar jtojnar added this to the 2.19 milestone Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants