mirror of
https://github.com/tycrek/degoogle.git
synced 2025-08-22 14:23:08 +02:00
fix: script was using moment instead of Luxon
This commit is contained in:
@@ -3,11 +3,11 @@
|
|||||||
const { EOL } = require('os');
|
const { EOL } = require('os');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const moment = require('moment');
|
const { DateTime } = require('luxon');
|
||||||
const YAML = require('yaml');
|
const YAML = require('yaml');
|
||||||
|
|
||||||
const BUILD_SECTION = {
|
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'),
|
index: () => readFile('md/_index.md'),
|
||||||
contributing: () => readFile('md/_contributing.md'),
|
contributing: () => readFile('md/_contributing.md'),
|
||||||
browserExtensions: () => generateBrowserExtensions(),
|
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 path = require('path'); // Get the correct path for README.md
|
||||||
const fetch = require('node-fetch'); // Make calls to Reddit from Node.js
|
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 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
|
//#region constants
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ function putWiki(lastId, token) {
|
|||||||
*/
|
*/
|
||||||
function fixContent(content) {
|
function fixContent(content) {
|
||||||
// Fix updated timestamp
|
// 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
|
// Fix published timestamps
|
||||||
content = content.replace(/\!\[Published\]\(https\:\/\/img\.shields\.io\/badge\//g, '**');
|
content = content.replace(/\!\[Published\]\(https\:\/\/img\.shields\.io\/badge\//g, '**');
|
||||||
|
Reference in New Issue
Block a user