Skip to content

Commit

Permalink
Removed static choose_locale method
Browse files Browse the repository at this point in the history
  • Loading branch information
purecatamphetamine committed Jan 7, 2018
1 parent cf1837a commit 5183c52
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ JavascriptTimeAgo.locale = function(locale_data_input)
JavascriptTimeAgo.locale_data[locale] = locale_data
}

// @param {string[]} locales
JavascriptTimeAgo.choose_locale = function(locales)
{
// Choose the most appropriate locale
// (one of the previously added ones)
// based on the list of preferred `locales` supplied by the user.
return choose_locale
(
locales.concat(JavascriptTimeAgo.default_locale),
Object.keys(JavascriptTimeAgo.locale_data)
)
}
// // @param {string[]} locales
// JavascriptTimeAgo.choose_locale = function(locales)
// {
// // Choose the most appropriate locale
// // (one of the previously added ones)
// // based on the list of preferred `locales` supplied by the user.
// return choose_locale
// (
// locales.concat(JavascriptTimeAgo.default_locale),
// Object.keys(JavascriptTimeAgo.locale_data)
// )
// }

// Normalizes `.format()` `time` argument.
function get_date_and_time_being_formatted(input)
Expand Down
10 changes: 5 additions & 5 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ describe(`time ago`, function()
console.log('Took', (Date.now() - started_at) / 1000, 'seconds')
})

it(`should provide a static ".choose_locale()" function`, function()
{
javascript_time_ago.choose_locale(['fr']).should.equal('en')
javascript_time_ago.choose_locale(['fr', 'ru']).should.equal('ru')
})
// it(`should provide a static ".choose_locale()" function`, function()
// {
// javascript_time_ago.choose_locale(['fr']).should.equal('en')
// javascript_time_ago.choose_locale(['fr', 'ru']).should.equal('ru')
// })

it(`should accept empty constructor parameters`, function()
{
Expand Down

0 comments on commit 5183c52

Please sign in to comment.