User Tag List

Results 1 to 5 of 5

Thread: time/date query - any advice?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb time/date query - any advice?

    Hi all,

    I'm trying to a create a app for work that does the following:

    User fills out a form.

    Name (edit box)
    Room (dropdown)
    Time (dropdown with 5 choices, ie 9-10am, 12-1pm)
    Date (calendar object)

    Once the user has filled/chosen what they want, it writes this back to a INI file
    ---
    ie
    [booking]
    Name=jim bob
    Room=S2
    Date=20/07/2016
    Time=P4 (12:40 to 13:35)
    ---

    Now, i set up another frame with 10 lines like the following:

    name1,room1,date1,time1
    name2,room2,date2,time2
    name3,room3,date3,time3
    etc

    I can read this data back from the ini file no problem but..

    I need to retrieve this data from and preferably order it by date/time.

    However, i also want to compare it to the day/time and set a flash/alarm to alert the person he needs to do this urgent job.

    I can not compare a time/date object to a string so am a bit perplexed how to solve this.

    Also, i imagine i would have to find a way of inputting a new entry without erasing things in the ini unless i want to.

    I have done something similar using mmf2/php/database but i'd rather just try and do all this inside of F2.5 this time.

    Any ideaS?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    If you setup your input dates to be formatted in a specific way,
    you can comfortably do both sorting and comparing,
    I would suggest saving dates as:

    YYYYMMDD(hhmm)
    (= if needed)

    make sure you use leading zeroes for numbers below 10
    in this way you can simply sort them with a list object
    and easily compare to "now":

    your YYYYMMMDD string = Str$(year("date&time")) + Str$(left$("00",2-len(month("date&time")))) +str$(month("date&time")) + Str$(left$("00",2-len(day("date&time")))+str$(day("date&time"))

    (pseudo code, but should be more or less "real")

    the left$("00",2-len(month("date&time"))) + str$(month("date&time")) thing to take care of leading zeroes

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    325
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would probably use the string parser 2 object and use "/" as a delimiter. Then element 1 would be day, element 2 month and element 3 year. And you can then convert these elements into numbers and compare it to the time/date object.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestions. Still a bit unsure but it gives me somewhere to start..

  5. #5
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleInstall Creator ProUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    573
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    You may want to retrieve the date format in the regional settings of the machine and have the ability where users can enter the date in the format they are used to.

Similar Threads

  1. 'Date And Time Object' how to set date?
    By King_Cool in forum Fusion 2.5
    Replies: 2
    Last Post: 6th December 2015, 11:04 AM
  2. Date & Time Object Changes Computer Time
    By StoDaBest in forum Fusion 2.5
    Replies: 5
    Last Post: 6th June 2015, 01:18 AM
  3. [RC6] Date&Time Bug (MFA and APK)
    By Koji_Kabuto in forum Android Export Module Version 2.0
    Replies: 8
    Last Post: 4th April 2013, 12:26 PM
  4. [bug] Date&time object doesn't show date
    By qenio in forum Android Export Module Version 2.0
    Replies: 3
    Last Post: 19th March 2012, 09:49 PM
  5. date & time
    By xiero in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 6th November 2010, 10:28 PM

Posting Permissions

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