months and years for autodate
This commit is contained in:
		
							parent
							
								
									e0ab091d09
								
							
						
					
					
						commit
						2b691408ed
					
				@ -103,7 +103,9 @@ function autodate($date) {
 | 
				
			|||||||
		if ($diff<60) return $diff . " minute" . plural($diff) . " ago"; $diff = round($diff/60);
 | 
							if ($diff<60) return $diff . " minute" . plural($diff) . " ago"; $diff = round($diff/60);
 | 
				
			||||||
		if ($diff<24) return $diff . " hour" . plural($diff) . " ago";   $diff = round($diff/24);
 | 
							if ($diff<24) return $diff . " hour" . plural($diff) . " ago";   $diff = round($diff/24);
 | 
				
			||||||
		if ($diff<7)  return $diff . " day" . plural($diff) . " ago";    $diff = round($diff/7);
 | 
							if ($diff<7)  return $diff . " day" . plural($diff) . " ago";    $diff = round($diff/7);
 | 
				
			||||||
		if ($diff<4)  return $diff . " week" . plural($diff) . " ago";
 | 
							if ($diff<4)  return $diff . " week" . plural($diff) . " ago";   $diff = round($diff/4);
 | 
				
			||||||
 | 
							if ($diff<12) return $diff . " month" . plural($diff) . " ago";  $diff = round($diff/12);
 | 
				
			||||||
 | 
							if ($diff<99) return $diff . " year" . plural($diff) . " ago";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	$format = $config->get_string('autodate_format', "F j, Y");
 | 
						$format = $config->get_string('autodate_format', "F j, Y");
 | 
				
			||||||
	return "on " . date($format, strtotime($date));
 | 
						return "on " . date($format, strtotime($date));
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user