简体   繁体   English

使YouMax 2.0中的时间戳使用Time Ago

[英]make timestamps in YouMax 2.0 use Time Ago

我想知道是否可以使用Time Ago替换YouMax 2.0中的timestamp函数,因为YouMax的时间戳仅以月和年表示。

Yes, I'm sure it's possible, but it doesn't seem as easy as setting an option when you initialize YouMax. 是的,我敢肯定这是可能的,但是这似乎不像初始化YouMax时设置选项那样容易。 You probably have to edit the code of YouMax – find the part where it writes the time, then change that code to call Time Ago. 您可能必须编辑YouMax的代码-找到它写时间的部分,然后更改该代码以调用Time Ago。 The code is distributed in minimized form, so you would have to use a beautifier like jsbeautifier.org to make the code remotely readable. 该代码以最小化形式分发,因此您必须使用jsbeautifier.org之类的美化工具才能使代码具有远程可读性。 Search for "month" in the code to find the relevant part. 在代码中搜索"month"以查找相关部分。

Another method, though much harder, is to let YouMax write its widget, then use AJAX in your own code to load each video's page, scrape the time, format it with Time Ago, and overwrite the existing time in the widget. 另一种方法(尽管难度更大)是让YouMax编写其小部件,然后在自己的代码中使用AJAX加载每个视频的页面,抓取时间,使用Time Ago对其进行格式化,以及覆盖小部件中的现有时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM