Javascript(216)
-
Javascript 현재 시간을 15단위로 표시하기
function getCurrentTimeRoundedTo15Minutes() { const now = new Date(); // Get the current hour and minute const hours = now.getHours(); const minutes = now.getMinutes(); // Round minutes to the nearest 15-minute increment const roundedMinutes = Math.round(minutes / 15) * 15; // Handle overflow of minutes (e.g., 60 minutes = next hour) const adjustedHours = (roundedMinutes ..
2024.12.05 -
Sencha timefield의 값과 표시를 분리하기
Ext.define('MyApp.view.TimeFieldExample', { extend: 'Ext.form.Panel', xtype: 'timefield-example', title: 'TimeField with Binding', width: 300, bodyPadding: 10, viewModel: { data: { timeValue: null, // Holds the actual time value timeText: '' // Holds the display text } }, renderTo: Ext.getBody(), items: [ { xtype: '..
2024.12.05 -
Javascript 모든 항목 replace 하기
let str = 'HH24:MI:SS HH24';str = str.replace(new RegExp('HH24', 'g'), '15');console.log(str); // Output: '15:MI:SS 15'
2024.12.05 -
Javascript 데이터 정렬하기
ascconst replacements = { 'YYYY': '2024', 'HH24': '15', 'HH': '03', 'MI': '12', 'SS': '45' };const keys = Object.keys(replacements).sort((a, b) => a.length - b.length);descconst keys = Object.keys(replacements).sort((a, b) => b.length - a.length);
2024.12.05 -
Sencha Custom js 파일 등록
app.json에 추가{ "name": "MyApp", "version": "1.0.0", "requires": [ "ext" ], "id": "MyApp", "js": [ { "path": "app.js", "bundle": true }, { "path": "resources/scripts/myCustomScript.js", "includeInBundle": false } ], "css": [ { "path": "resources/css/app.css", "bundle"..
2024.12.05 -
Javascript 날짜에 패턴 적용하기
function formatCustomDate(date, pattern) { // Replace year, month, day, hours, minutes, seconds dynamically const replacements = { 'YYYY': date.getFullYear().toString(), 'MM': (date.getMonth() + 1).toString().padStart(2, '0'), 'DD': date.getDate().toString().padStart(2, '0'), 'HH24': date.getHours().toString().padStart(2, '0'), // 24-hour format 'HH': (da..
2024.12.05