mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 15:34:13 +00:00 
			
		
		
		
	Allow only one kind of date identifier at once (#5120)
This commit is contained in:
		
							parent
							
								
									5343b005df
								
							
						
					
					
						commit
						c2c06694da
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -42,7 +42,7 @@ function formatDateTimeString(date: Date, format: string): string {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
export function formatTimeString(date: Date, format: string): string {
 | 
			
		||||
	return format.replace(/\[(([^\[]|\[\])*)\]|([yMdHhmst]{1,4})/g, (match: string, localeformat?: string, unused?, datetimeformat?: string) => {
 | 
			
		||||
	return format.replace(/\[(([^\[]|\[\])*)\]|(([yMdHhmst])\4{0,3})/g, (match: string, localeformat?: string, unused?, datetimeformat?: string) => {
 | 
			
		||||
		if (localeformat) return formatLocaleString(date, localeformat);
 | 
			
		||||
		if (datetimeformat) return formatDateTimeString(date, datetimeformat);
 | 
			
		||||
		return match;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue