mirror of
https://github.com/tycrek/degoogle.git
synced 2025-04-21 15:01:55 +02:00
fix: script was using moment instead of Luxon
This commit is contained in:
parent
cdf2bb7ee9
commit
284a5a61be
@ -3,11 +3,11 @@
|
||||
const { EOL } = require('os');
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
const moment = require('moment');
|
||||
const { DateTime } = require('luxon');
|
||||
const YAML = require('yaml');
|
||||
|
||||
const BUILD_SECTION = {
|
||||
header: () => readFile('md/_header.md').replace('{{DATE}}', moment().format('MMMM Do YYYY').replace(/ /g, '%20')),
|
||||
header: () => readFile('md/_header.md').replace('{{DATE}}', DateTime.now().toFormat('MMMM dd, yyyy').replace(/ /g, '%20')),
|
||||
index: () => readFile('md/_index.md'),
|
||||
contributing: () => readFile('md/_contributing.md'),
|
||||
browserExtensions: () => generateBrowserExtensions(),
|
||||
|
4
_wiki.js
4
_wiki.js
@ -2,7 +2,7 @@ const fs = require('fs-extra'); // Reading README.md
|
||||
const path = require('path'); // Get the correct path for README.md
|
||||
const fetch = require('node-fetch'); // Make calls to Reddit from Node.js
|
||||
const qs = require('qs'); // Properly build a query for node-fetch POST
|
||||
const moment = require('moment'); // Time-related functions
|
||||
const { DateTime } = require('luxon'); // Time-related functions
|
||||
|
||||
//#region constants
|
||||
|
||||
@ -96,7 +96,7 @@ function putWiki(lastId, token) {
|
||||
*/
|
||||
function fixContent(content) {
|
||||
// Fix updated timestamp
|
||||
content = content.replace(/\!\[Updated\](.*?)square\)/g, `#### Updated: ${moment().format('MMMM Do YYYY')}`);
|
||||
content = content.replace(/\!\[Updated\](.*?)square\)/g, `#### Updated: ${DateTime.now().toFormat('MMMM dd, yyyy')}`);
|
||||
|
||||
// Fix published timestamps
|
||||
content = content.replace(/\!\[Published\]\(https\:\/\/img\.shields\.io\/badge\//g, '**');
|
||||
|
Loading…
x
Reference in New Issue
Block a user