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

Impossible to set no suffix #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions humandate.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@
if (!options) {
options = {};
}
if (!options.futureSuffix) {
if (!('futureSuffix' in options)) {
options.futureSuffix = 'from now';
}
if (!options.pastSuffix) {
if (!('pastSuffix' in options)) {
options.pastSuffix = 'ago';
}
if (!options.presentText) {
if (!('presentText' in options)) {
options.presentText = 'now';
}
if (!options.returnObject) {
if (!('returnObject' in options)) {
options.returnObject = false;
}
isPast = seconds < 0 ? true : false;
Expand Down Expand Up @@ -101,7 +101,7 @@
if (time.seconds) {
append(time.seconds, 'second');
}
return output.join(', ') + ' ' + suffix;
return output.join(', ') + (suffix ? (' ' + suffix) : '');
},
prettyPrint: function prettyPrint(input, options) {
var date, hdate, day, humanDate, year, month, tstr, hours, minutes, ampm;
Expand Down
2 changes: 1 addition & 1 deletion humandate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.