Javascript(199)
-
Javascript 시간 더하기
function addMinutesToCurrentTime(minutesToAdd) { const now = new Date(); // Get the current date and time now.setMinutes(now.getMinutes() + minutesToAdd); // Add 15 minutes return now;}// Example usageconst updatedTime = addMinutesToCurrentTime(15);console.log(updatedTime.toLocaleTimeString('en-US', { hour12: false })); // Example output: "15:30:00" (24-hour format)
2024.12.05 -
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