403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/date-picker/src/helpers/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/date-picker/src/helpers/convert-to-db-format.js
const replacements: Object<string, string> = {
	Y: 'YYYY', // 1999
	M: 'MMM', // Jan - Dec
	f: 'MMMM', // January - December
	m: 'MM', // 01 - 12
	d: 'DD', // 01 - 31
	A: 'TT', // AM - PM
	a: 'T', // am - pm
	i: 'MI', // 00 - 59
	s: 'SS', // 00 - 59
	H: 'HH', // 00 - 24
	h: 'H', // 01 - 12
	G: 'GG', // 0 - 24
	g: 'G', // 1 - 12
	j: 'DD', // 1 to 31
	n: 'MM', // 1 to 31
};

export function convertToDbFormat(format: string): string
{
	let result = format;
	for (const [from, to] of Object.entries(replacements))
	{
		result = result.replace(from, to);
	}

	return result;
}

// const tests = {
// 	'Y-m-d H:i': 'YYYY-MM-DD HH:MI:SS',
// 	'Y/m/d G:i': 'YYYY/MM/DD HH:MI:SS',
// 	'd-m-Y H:i': 'DD/MM/YYYY HH:MI:SS',
// 	'd.m.Y H:i': 'DD.MM.YYYY HH:MI:SS',
// 	'd/m/Y H:i': 'DD/MM/YYYY HH:MI:SS',
// 	'd/m/Y H:i \น\.': 'DD/MM/YYYY HH:MI:SS',
// 	'd/m/Y g:i a': 'DD/MM/YYYY H:MI:SS T',
// 	'd/m/Y g:i a': 'DD/MM/YYYY HH:MI:SS',
// 	'j.m.Y H:i': 'DD.MM.YYYY HH:MI:SS',
// 	'j/n/Y G:i': 'DD.MM.YYYY HH:MI:SS',
// 	'j/n/Y G:i': 'DD/MM/YYYY HH:MI:SS',
// 	'j/n/Y H:i': 'DD/MM/YYYY HH:MI:SS',
// 	'j/n/Y g:i a': 'DD/MM/YYYY HH:MI:SS', //
// 	'j/n/Y g:i a': 'DD/MM/YYYY H:MI:SS T', // co
// 	'n/j/Y g:i a': 'MM/DD/YYYY H:MI:SS T',
// 	// 'n/j/Y g:i a': 'DD-MM-YYYY H:MI:SS T', // hi
// };

Youez - 2016 - github.com/yon3zu
LinuXploit