mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	closes #5242
This commit is contained in:
		| @@ -150,7 +150,12 @@ if ('undefined' !== typeof window) { | |||||||
|  |  | ||||||
| 	overrides.overrideTimeago = function () { | 	overrides.overrideTimeago = function () { | ||||||
| 		var timeagoFn = $.fn.timeago; | 		var timeagoFn = $.fn.timeago; | ||||||
| 		$.timeago.settings.cutoff = 1000 * 60 * 60 * 24 * (parseInt(config.timeagoCutoff, 10) || 60); | 		if (parseInt(config.timeagoCutoff, 10) === 0) { | ||||||
|  | 			$.timeago.settings.cutoff = 1; | ||||||
|  | 		} else if (parseInt(config.timeagoCutoff, 10) > 0) { | ||||||
|  | 			$.timeago.settings.cutoff = 1000 * 60 * 60 * 24 * (parseInt(config.timeagoCutoff, 10) || 30); | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		$.fn.timeago = function () { | 		$.fn.timeago = function () { | ||||||
| 			var els = $(this); | 			var els = $(this); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -63,7 +63,9 @@ apiController.getConfig = function (req, res, next) { | |||||||
| 	config.csrf_token = req.csrfToken(); | 	config.csrf_token = req.csrfToken(); | ||||||
| 	config.searchEnabled = plugins.hasListeners('filter:search.query'); | 	config.searchEnabled = plugins.hasListeners('filter:search.query'); | ||||||
| 	config.bootswatchSkin = 'default'; | 	config.bootswatchSkin = 'default'; | ||||||
| 	config.timeagoCutoff = meta.config.timeagoCutoff; |  | ||||||
|  | 	var timeagoCutoff = meta.config.timeagoCutoff === undefined ? 30 : meta.config.timeagoCutoff; | ||||||
|  | 	config.timeagoCutoff = timeagoCutoff !== '' ? Math.max(0, parseInt(timeagoCutoff, 10)) : timeagoCutoff; | ||||||
|  |  | ||||||
| 	config.cookies = { | 	config.cookies = { | ||||||
| 		enabled: parseInt(meta.config.cookieConsentEnabled, 10) === 1, | 		enabled: parseInt(meta.config.cookieConsentEnabled, 10) === 1, | ||||||
|   | |||||||
| @@ -94,7 +94,7 @@ | |||||||
| 				<p class="help-block"> | 				<p class="help-block"> | ||||||
| 					Dates & times will be shown in a relative manner (e.g. "3 hours ago" / "5 days ago"), and localised into various | 					Dates & times will be shown in a relative manner (e.g. "3 hours ago" / "5 days ago"), and localised into various | ||||||
| 					languages. After a certain point, this text can be switched to display the localised date itself | 					languages. After a certain point, this text can be switched to display the localised date itself | ||||||
| 					(e.g. 5 Nov 2016 15:30).<br /><em>(Default: <code>30</code>, or one month)</em> | 					(e.g. 5 Nov 2016 15:30).<br /><em>(Default: <code>30</code>, or one month). Set to 0 to always display dates, leave blank to always display relative times.</em> | ||||||
| 				</p> | 				</p> | ||||||
| 			</div> | 			</div> | ||||||
| 		</form> | 		</form> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user