Skip to content

Commit

Permalink
chore: clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
mrholek committed Apr 22, 2024
1 parent 9f735a8 commit 68c64de
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 89 deletions.
2 changes: 0 additions & 2 deletions docs/assets/js/code-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/* global ClipboardJS: false, coreui: false */

(() => {
'use strict'

// Insert copy to clipboard button before .highlight
const btnTitle = 'Copy to clipboard'
const btnEdit = 'Edit on StackBlitz'
Expand Down
2 changes: 0 additions & 2 deletions docs/assets/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// ++++++++++++++++++++++++++++++++++++++++++

(() => {
'use strict'

const searchElement = document.getElementById('docsearch')

if (!window.docsearch || !searchElement) {
Expand Down
85 changes: 0 additions & 85 deletions js/src/util/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,88 +191,3 @@ export const isValidTime = time => {
const d = new Date(`1970-01-01 ${time}`)
return d instanceof Date && d.getTime()
}

// export const convert12hTo24h = (abbr, hour) => {
// if (abbr === 'am' && hour === 12) {
// return 0
// }

// if (abbr === 'am') {
// return hour
// }

// if (abbr === 'pm' && hour === 12) {
// return 12
// }

// return hour + 12
// }

// export const convert24hTo12h = hour => hour % 12 || 12

// export const convertTimeToDate = time =>
// time ?
// (time instanceof Date ?
// time :
// new Date(`1970-01-01 ${time}`)) :
// null

// export const getAmPm = (date, locale) => {
// if (date.toLocaleTimeString(locale).includes('AM')) {
// return 'am'
// }

// if (date.toLocaleTimeString(locale).includes('PM')) {
// return 'pm'
// }

// return date.getHours() >= 12 ? 'pm' : 'am'
// }

// export const getListOfHours = (locale, ampm = 'auto') => Array.from({ length: (ampm === 'auto' && isAmPm(locale)) || ampm === true ? 12 : 24 }, (_, i) => {
// return {
// value: (ampm === 'auto' && isAmPm(locale)) || ampm === true ? i + 1 : i,
// label: ((ampm === 'auto' && isAmPm(locale)) || ampm === true ? i + 1 : i).toLocaleString(locale)
// }
// })

// export const getListOfMinutes = (locale, valueAsString = false) => Array.from({ length: 60 }, (_, i) => {
// const d = new Date()
// d.setMinutes(i)
// return {
// value: valueAsString ? i.toString() : i,
// label: d
// .toLocaleTimeString(locale, {
// minute: '2-digit',
// second: '2-digit'
// })
// .split(/[^\dA-Za-z\u06F0-\u06F9]/)[0]
// }
// })

// export const getListOfSeconds = (locale, valueAsString = false) => Array.from({ length: 60 }, (_, i) => {
// const d = new Date()
// d.setSeconds(i)
// return {
// value: valueAsString ? i.toString() : i,
// label: d
// .toLocaleTimeString(locale, {
// minute: '2-digit',
// second: '2-digit'
// })
// .split(/[^\dA-Za-z\u06F0-\u06F9]/)[1]
// }
// })

// export const getSelectedHour = (date, locale) => date ? (isAmPm(locale) ? convert24hTo12h(date.getHours()) : date.getHours()) : ''

// export const getSelectedMinutes = date => (date ? date.getMinutes() : '')

// export const getSelectedSeconds = date => (date ? date.getSeconds() : '')

// export const isAmPm = locale => ['am', 'AM', 'pm', 'PM'].some(el => new Date().toLocaleString(locale).includes(el))

// export const isValidTime = time => {
// const d = new Date(`1970-01-01 ${time}`)
// return d instanceof Date && d.getTime()
// }

0 comments on commit 68c64de

Please sign in to comment.