Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge 704876d into 1fc4c0c
Browse files Browse the repository at this point in the history
  • Loading branch information
jkc committed Dec 5, 2017
2 parents 1fc4c0c + 704876d commit fdab3be
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions History.md
@@ -1,3 +1,8 @@
# 1.2.0

* Fixed issue in comb.date.format not correctly returning an abbreviated weekday name for "EEE"
* Removed periods from abbreviated month name list. Punctuation should be added in the format string to be more flexible.

# 1.1.0

* Porting 1.1.0 code back to 1.0.1 so we don't have to updated all the dependent apps.
Expand Down
4 changes: 2 additions & 2 deletions lib/base/date/index.js
Expand Up @@ -24,7 +24,7 @@ function getString() {

var floor = Math.floor, round = Math.round, min = Math.min, pow = Math.pow, ceil = Math.ceil, abs = Math.abs;
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var monthAbbr = ["Jan.", "Feb.", "Mar.", "Apr.", "May.", "Jun.", "Jul.", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."];
var monthAbbr = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var monthLetter = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
var dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var dayAbbr = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
Expand Down Expand Up @@ -691,7 +691,7 @@ comb.date = {
s = day + 1;
pad = true;
} else {
s = (l === -3 ? dayAbbr : dayNames)[day];
s = (l === 3 ? dayAbbr : dayNames)[day];
}
} else if (c === 'a') {
s = (hour < 12) ? 'AM' : 'PM';
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "comb",
"description": "A framework for node",
"version": "1.0.1",
"version": "1.2.0",
"keywords": [
"OO",
"Object Oriented",
Expand Down
4 changes: 4 additions & 0 deletions test/base/date.test.js
Expand Up @@ -190,6 +190,10 @@ it.describe("comb.date", function (it) {
assert.equal(date.format("E", true), "6");
});

it.should("EEE to Fri ", function () {
assert.equal(date.format("EEE", true), "Fri")
});

it.should("h:m a to 5:55 AM ", function () {
assert.equal(date.format("h:m a", true), ((date.getUTCHours() % 12) || 12) + ":55 AM");
});
Expand Down

0 comments on commit fdab3be

Please sign in to comment.