Skip to content

Commit

Permalink
feat(core): new locale option to render dates in the right format
Browse files Browse the repository at this point in the history
  • Loading branch information
rprieto committed Jul 8, 2019
1 parent 3671c12 commit 847f343
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -133,6 +133,7 @@ Website options:
--footer Text or HTML footer [default: null]
--google-analytics Code for Google Analytics tracking [string]
--embed-exif Embed the exif metadata for each image into the gallery page [boolean] [default: false]
--locale Locale for regional settings like dates [string] [default: "en"]
Misc options:
--config JSON config file (one key per argument) [string]
Expand Down
6 changes: 6 additions & 0 deletions bin/options.js
Expand Up @@ -274,6 +274,12 @@ const OPTIONS = {
type: 'boolean',
'default': false
},
'locale': {
group: 'Website options:',
description: 'Locale for regional settings like dates',
type: 'string',
'default': 'en'
},

// ------------------------------------
// Misc options
Expand Down
4 changes: 4 additions & 0 deletions bin/thumbsup.js
Expand Up @@ -2,6 +2,7 @@

const fs = require('fs-extra')
const path = require('path')
const moment = require('moment')
const Analytics = require('./analytics')
const dependencies = require('./dependencies')
const messages = require('./messages')
Expand Down Expand Up @@ -43,6 +44,9 @@ if (missingErrors) {
exit(1)
}

// Global settings
moment.locale(opts.locale)

// Build the gallery!
index.build(opts, (err, result) => {
console.log('')
Expand Down

0 comments on commit 847f343

Please sign in to comment.