OFBiz
  1. OFBiz
  2. OFBIZ-3161

We should check that the thru date is not same or older than the from date

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Implemented
    • Affects Version/s: Trunk
    • Fix Version/s: Trunk
    • Component/s: ALL APPLICATIONS
    • Labels:
      None

      Description

      In any places we use a from and thru dates, we should check that the thru date is not same or older than the from date

      1. OFBIZ-3161.patch
        0.7 kB
        Ankit Jain
      2. OFBIZ-3161.patch
        2 kB
        Ankit Jain
      3. OFBIZ-3161.patch
        2 kB
        Jacques Le Roux

        Activity

        Hide
        Jacques Le Roux added a comment -

        Thanks Ankit,

        I committed a modified patch in trunk at revision: 1598977

        Show
        Jacques Le Roux added a comment - Thanks Ankit, I committed a modified patch in trunk at revision: 1598977
        Hide
        Jacques Le Roux added a comment -

        Same patch than last Ankit's but taking into account that the dates can't be same

        Show
        Jacques Le Roux added a comment - Same patch than last Ankit's but taking into account that the dates can't be same
        Hide
        Jacques Le Roux added a comment -

        Ankit,

        Just a tip: for the error message, you could maybe have something like in ajaxSubmitFormUpdateAreas with data.ERROR_MESSAGE
        if (data.ERROR_MESSAGE_LIST != undefined || data.ERROR_MESSAGE != undefined)
        but not sure from where and how the data.ERROR_MESSAGE content should come...

        Show
        Jacques Le Roux added a comment - Ankit, Just a tip: for the error message, you could maybe have something like in ajaxSubmitFormUpdateAreas with data. ERROR_MESSAGE if (data. ERROR_MESSAGE_LIST != undefined || data. ERROR_MESSAGE != undefined) but not sure from where and how the data. ERROR_MESSAGE content should come...
        Hide
        Ankit Jain added a comment -

        Hello Jacques,

        Thanks to look into it , i'll upadte my patch for error message, Jacques in our form-widget the ids are auto generated and is something like "formName_fieldName" , so how could you query through ids.

        Currently the code is handling two field FromDate and ThruDate , but it may be possible if anyone want to use it for WorkEffort StartDate and EndDate than? so i talked about generalised solution .

        As we do in ftls we add a class for field and in js we can fetch fields that have our class and do the operations accordingly , that something i was saying and if possible we'll apply here , So anyone can use for checking two date fields which have different names.

        Its weekend so i'll try it on Monday. Happy Weekend....

        Thanks & Regards
        Ankit Jain

        Show
        Ankit Jain added a comment - Hello Jacques, Thanks to look into it , i'll upadte my patch for error message, Jacques in our form-widget the ids are auto generated and is something like "formName_fieldName" , so how could you query through ids. Currently the code is handling two field FromDate and ThruDate , but it may be possible if anyone want to use it for WorkEffort StartDate and EndDate than? so i talked about generalised solution . As we do in ftls we add a class for field and in js we can fetch fields that have our class and do the operations accordingly , that something i was saying and if possible we'll apply here , So anyone can use for checking two date fields which have different names. Its weekend so i'll try it on Monday. Happy Weekend.... Thanks & Regards Ankit Jain
        Hide
        Jacques Le Roux added a comment -

        Looks good so far Ankit (just reviewed for now)

        Could you have a look at the error message i18n issue please? How do you envision to make the code generic, could you explain? (I can see very easy solutions by quering all possible date field through id (if date is in) or CSS, etc. but I can't find a completely generic solution...)

        Thanks

        Show
        Jacques Le Roux added a comment - Looks good so far Ankit (just reviewed for now) Could you have a look at the error message i18n issue please? How do you envision to make the code generic, could you explain? (I can see very easy solutions by quering all possible date field through id (if date is in) or CSS, etc. but I can't find a completely generic solution...) Thanks
        Hide
        Ankit Jain added a comment -

        Sorry I missed one file in my patch, so this is the updated patch.

        Thanks
        Ankit Jain

        Show
        Ankit Jain added a comment - Sorry I missed one file in my patch, so this is the updated patch. Thanks Ankit Jain
        Hide
        Ankit Jain added a comment -

        Hello All,

        This is something needed at many places , i created a patch in jquery and as i tested at many places its working fine . Currently the code is specific to fields having name "fromDate" and "thruDate", further we can improve the code and make it generic.

        The patch is a sample and we can improve it further.

        Thanks & Regards
        Ankit Jain

        Show
        Ankit Jain added a comment - Hello All, This is something needed at many places , i created a patch in jquery and as i tested at many places its working fine . Currently the code is specific to fields having name "fromDate" and "thruDate", further we can improve the code and make it generic. The patch is a sample and we can improve it further. Thanks & Regards Ankit Jain

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Jacques Le Roux
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development