Adding Chrono to parse relative date

This commit is contained in:
Jarzon 2017-01-31 06:26:11 -05:00
parent 444649ee8c
commit f1b742dff4
2 changed files with 4 additions and 2 deletions

View File

@ -2,6 +2,7 @@ var SteamCommunity = require('../index.js');
var SteamID = require('steamid');
var xml2js = require('xml2js');
var Cheerio = require('cheerio');
var chrono = require('chrono-node');
SteamCommunity.prototype.getGroupMembers = function(gid, callback, members, link, addresses, addressIdx) {
members = members || [];
@ -545,7 +546,7 @@ SteamCommunity.prototype.getAllGroupComments = function(gid, from, count, callba
cachedSelector = $(this).find(".commentthread_author_link");
comment.authorName = $(cachedSelector).find("bdi").text();
comment.authorId = $(cachedSelector).attr('href').replace("http://steamcommunity.com/id/", "");
comment.date = $(this).find(".commentthread_comment_timestamp").text().trim();
comment.date = chrono.parseDate($(this).find(".commentthread_comment_timestamp").text().trim());
cachedSelector = $(this).find(".commentthread_comment_text");

View File

@ -19,7 +19,8 @@
"xml2js": "^0.4.11",
"cheerio": "0.22.0",
"async": "^2.1.4",
"steam-totp": "^1.3.0"
"steam-totp": "^1.3.0",
"chrono-node": "^1.2.5"
},
"engines": {
"node": ">=4.0.0"