mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	closes #5242
This commit is contained in:
		| @@ -150,7 +150,12 @@ if ('undefined' !== typeof window) { | ||||
|  | ||||
| 	overrides.overrideTimeago = function () { | ||||
| 		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 () { | ||||
| 			var els = $(this); | ||||
|  | ||||
|   | ||||
| @@ -63,7 +63,9 @@ apiController.getConfig = function (req, res, next) { | ||||
| 	config.csrf_token = req.csrfToken(); | ||||
| 	config.searchEnabled = plugins.hasListeners('filter:search.query'); | ||||
| 	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 = { | ||||
| 		enabled: parseInt(meta.config.cookieConsentEnabled, 10) === 1, | ||||
|   | ||||
| @@ -94,7 +94,7 @@ | ||||
| 				<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 | ||||
| 					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> | ||||
| 			</div> | ||||
| 		</form> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user