Skip to content

Commit

Permalink
Merge branch 'release/0.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Jul 25, 2018
2 parents 5f52c99 + 2e4beb3 commit d443143
Show file tree
Hide file tree
Showing 5 changed files with 3,125 additions and 14 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,20 @@ This extension requires that you're either:
Currently there are no settings
## Known Issues

- Likely to be incompatible with Mac. ([Pull requests welcome!](https://github.com/BeauAgst/blamer-vs/issues/1))
- Possibly incompatible with Mac. ([Pull requests welcome!](https://github.com/BeauAgst/blamer-vs/issues/1))
- A little bit slow, because all unique logs have to be retrieved first. ([Issue](https://github.com/BeauAgst/blamer-vs/issues/3))

## Release Notes

## 0.3.2
- Fixed decoration issue causing characters to show incorrectly dependant on the language [#6](https://github.com/BeauAgst/blamer-vs/issues/6)

## 0.3.1
- Removed formatting error in decoration caused by conflict with `mailto:`
- Added icon to extension

## 0.3.0
- Linux support added.
- Linux support added. [#2](https://github.com/BeauAgst/blamer-vs/issues/2)

## 0.2.0
- Added keyboard shortcut
Expand Down
44 changes: 44 additions & 0 deletions functions/formatDate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];

const days = [
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
];

const nth = (d) => {
if(d>3 && d<21) return 'th';
switch (d % 10) {
case 1: return "st";
case 2: return "nd";
case 3: return "rd";
default: return "th";
}
};

module.exports = (dateString) => {
const date = new Date(dateString);
const day = date.getDate();
const dayIndex = date.getDay();
const monthIndex = date.getMonth();
const year = date.getFullYear();

return `${days[dayIndex]} ${day}${nth(day)} ${months[monthIndex]} ${year}`;
};
Loading

0 comments on commit d443143

Please sign in to comment.