Skip to content

Commit ba91856

Browse files
author
Adnan Ahmed
committed
updated date format and fixed encoding decoding issue
1 parent 8284950 commit ba91856

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/widget.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ chrome.browserAction.onClicked.addListener(function (tab) {
2626

2727
var sha = response.sha,
2828
encodedContent = response.content,
29-
decodedContent = window.atob(encodedContent);
29+
decodedContent = decodeURIComponent(escape(window.atob(encodedContent)));
3030

3131
// If the file is empty
3232
if ($.trim(decodedContent) === '') {
@@ -98,7 +98,7 @@ chrome.browserAction.onClicked.addListener(function (tab) {
9898
* @returns {string}
9999
*/
100100
function getDateHeader() {
101-
return "\n###" + getCurrentDate() + '\n';
101+
return "\n### " + getCurrentDate() + '\n';
102102
}
103103

104104
/**
@@ -118,7 +118,7 @@ chrome.browserAction.onClicked.addListener(function (tab) {
118118
*/
119119
function getCurrentDate() {
120120
var date = new Date();
121-
return monthNames()[date.getMonth()] + " " + pad(date.getDate()) + ", " + date.getFullYear();
121+
return monthNames()[date.getMonth()] + " " + date.getDate() + ", " + date.getFullYear();
122122
}
123123

124124
/**

0 commit comments

Comments
 (0)