我想要jquery timeago只显示我在几天的时间!我的意思是,当通过30天时,它会显示我31,32,32天而不是1个月。感谢您的pront答案。Jquery Time Ago only days in
回答
一个解决方案是修改插件以获得您描述的行为。考虑行jquery.timeago.js 83:
days < 30 && substitute($l.days, Math.round(days)) ||
举个例子,如果你改变30
到40
,像这样:
days < 40 && substitute($l.days, Math.round(days)) ||
插件将仍显示 “X天前”直到39天前。
如果要禁用单位比“天”更大的干脆,你可以只取出那部分words
分配中,像这样:
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
seconds < 90 && substitute($l.minute, 1) ||
minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
minutes < 90 && substitute($l.hour, 1) ||
hours < 24 && substitute($l.hours, Math.round(hours)) ||
hours < 42 && substitute($l.day, 1) ||
substitute($l.days, Math.round(days));
hello andrewap! thax为您的答案!它真的帮助我。 – morrisonrox
@morrisonrox你非常欢迎!请考虑通过点击巨大的绿色复选标记来接受我的答案。 – Andrew
其已完成。还有thanx。 – morrisonrox
- 1. Javascript Epoch Time In Days
- 2. jQuery Time Ago
- 3. jQuery Time Ago with Twitter Plugin
- 4. python last posting before n days ago
- 5. “Time ago”from MySQL timestamp
- 6. Swift time ago from Parse createdAt date
- 7. geometry.mergeVertices()only only at render time
- 8. jQuery .attr()undefined only in Chrome
- 9. Angular 2“ago ago”pipe
- 10. @ Symbol In Object Key Name Only Only in Chrome?
- 11. display:table-cell only not in IE11 only
- 12. Delta Indexing Only Only in Console
- 13. CONVERT十进制DAYS到TIME格式
- 14. JTextField time in HH:mm:ss
- 15. Jquery Datepicker Days
- 16. Ant-Pathelement with wildcard only only in Javac forked mode
- 17. srand(time(NULL))in C++
- 18. Just-In-Time Asset Packager
- 19. WatchPosition Time Out In Geolocation
- 20. Ruby on Rails Time In/Time Out Records
- 21. Time Ago函数在Clojure中的实现如何?
- 22. vb.net ClassNotRegistered error only in Release
- 23. Actioscript Error#2032 only in IE
- 24. Rails 3 - 给定日期的助手是否会返回“Today”,“Yesterday”或“x days ago”?
- 25. 如何使用Time in Rails?
- 26. JavaScript Just In Time编译
- 27. jquery safari opacity only
- 28. JQuery Mobile Styles Only
- 29. ONLY jQuery中
- 30. Parse“X years and Y weeks ago”like Ruby in Ruby
哪个插件?你必须更具体。 – Blender
对不起,我的意思是拔插!我的意思是jquery timeago,你可以在这里找到http://timeago.yarp.com/ – morrisonrox