1.0.0 • Published 10 years ago

google-hours-parser v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

gHoursParser

Parse Google Places hours strings into POJO. Expects string to be formatted in the way described here.

  • 24 hour format: dayOfWeek:hh:mm:hh:mm
  • AM/PM format: dayOfWeek:hh:mm:AMorPM:hh:mm:AMorPM

before:

1:10:00:18:00,2:10:00:18:00,3:10:00:18:00,4:10:00:18:00,5:10:00:18:00,6:10:00:18:00,7:12:00:20:00

after:

{
  sunday: {
    open: '10',
    close: 18
  },
  monday: {
    open: '10',
    close: 18
  },
  tuesday: {
    open: '10',
    close: 18
  },
  wednesday: {
    open: '10',
    close: 18
  },
  thursday: {
    open: '10',
    close: 18
  },
  friday: {
    open: '10',
    close: 18
  },
  saturday: {
    open: 24,
    close: 20
  }
}