mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Change chat export naming scheme
Filename is now sortable alphabetically for chronological order, approximates default byond log name scheme.
This commit is contained in:
@@ -599,12 +599,18 @@ function start_vue() {
|
|||||||
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
|
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
|
||||||
hiddenElement.target = '_blank';
|
hiddenElement.target = '_blank';
|
||||||
|
|
||||||
var fileprefix = "chat_export";
|
var fileprefix = "log";
|
||||||
var extension =".html";
|
var extension =".html";
|
||||||
|
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var hours = String(now.getHours());
|
var hours = String(now.getHours());
|
||||||
|
if(hours.length < 2) {
|
||||||
|
hours = "0" + hours;
|
||||||
|
}
|
||||||
var minutes = String(now.getMinutes());
|
var minutes = String(now.getMinutes());
|
||||||
|
if(minutes.length < 2) {
|
||||||
|
minutes = "0" + minutes;
|
||||||
|
}
|
||||||
var dayofmonth = String(now.getDate());
|
var dayofmonth = String(now.getDate());
|
||||||
if(dayofmonth.length < 2) {
|
if(dayofmonth.length < 2) {
|
||||||
dayofmonth = "0" + dayofmonth;
|
dayofmonth = "0" + dayofmonth;
|
||||||
@@ -614,7 +620,7 @@ function start_vue() {
|
|||||||
month = "0" + month;
|
month = "0" + month;
|
||||||
}
|
}
|
||||||
var year = String(now.getFullYear());
|
var year = String(now.getFullYear());
|
||||||
var datesegment = "_"+hours+minutes+"_"+dayofmonth+"_"+month+"_"+year;
|
var datesegment = " "+year+"-"+month+"-"+dayofmonth+" ("+hours+" "+minutes+")";
|
||||||
|
|
||||||
var filename = fileprefix+datesegment+extension;
|
var filename = fileprefix+datesegment+extension;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user