SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2013
    Location
    Lisboa, Portugal
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Build a Time Loop select after have some info from XML

    Hi,

    I need some help with following.

    I'm acessing one car rental webservice and i already get some values from it. They are for example:

    Schedule weekdays hours:
    WeekDayOpen: 08:00
    WeekDayClose: 20:00

    Schedule about Lunch hours
    WeekdayLunchIni: 13:00
    WeekdayLunchFim: 14:00

    Schedule about Saturday hours:
    SaturDayOpen: 08:00
    SaturDayClose: 20:00

    Schedule about Sunday hours:
    SunDayOpen: 08:00
    SunDayClose: 20:00

    I need create one select with options inside...
    i need show hours at 15 minute intervals:

    Example:
    WeekDayOpen: 08:00 or SaturDayOpen: 08:00 or SunDayOpen: 08:00 depending on the day of the week
    08:15:00
    08:30:00
    ....
    12:45 (last time before lunch)
    WeekdayLunchIni: 13:00 (will not appear, only to be considered from monday to friday)
    WeekdayLunchFim: 14:00 (will not appear, only to be considered from monday to friday)
    14:15 (first time after lunch)
    .....
    ....
    ...
    WeekDayClose: 20:00 or SaturDayClose: 20:00 or SunDayClose: 20:00 (depending on the day of the week)

    I know use Weekday, Arrays e TimeSerial, however my problem is create correct range from Open to Close ?
    I use TimeSerial(HoraAbertura,min,sec), but i don't know formula to create number correct of steps of 15 minutes, i never get correct range...

    Or have less that i want (close hour) or more, never correct close hour.

    Any help is welcome.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by prodrigue76 View Post
    Hi,


    I know use Weekday, Arrays e TimeSerial, however my problem is create correct range from Open to Close ?
    I use TimeSerial(HoraAbertura,min,sec), but i don't know formula to create number correct of steps of 15 minutes, i never get correct range...

    Or have less that i want (close hour) or more, never correct close hour.
    can you show the code you have ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •