mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 08:16:50 +08:00
chore: convert functions to an ES2015 classes (#1656)
* chore: convert functions to an ES2015 classes * remove unnecessary functions
This commit is contained in:
@ -24,8 +24,8 @@ const RailwayTimeConversion = (timeString) => {
|
||||
const [hour, minute, secondWithShift] = timeString.split(':')
|
||||
// split second and shift value.
|
||||
const [second, shift] = [
|
||||
secondWithShift.substr(0, 2),
|
||||
secondWithShift.substr(2)
|
||||
secondWithShift.substring(0, 2),
|
||||
secondWithShift.substring(2)
|
||||
]
|
||||
// convert shifted time to not-shift time(Railway time) by using the above explanation.
|
||||
if (shift === 'PM') {
|
||||
|
Reference in New Issue
Block a user