Forum Replies Created
-
AuthorPosts
-
Steve Jonasson
ParticipantIt looks like I got it working:
function endOfQuarantine() { let d = spjs.utility.getDateFieldAsDateObject('positiveSince'); let dd = new Date(d); dd.setDate(dd.getDate()+14); let day = dd.getDate(); let month = dd.getMonth()+1; let year = dd.getFullYear(); let finalDate = (day +". "+ month + ". "+year); setFieldValue('positiveTo',finalDate); }
Steve Jonasson
ParticipantThank you Alex, I figured it out.
Field DFFS by SPJSBlog.com was in the content type set as “Hidden”.
Now, it works perfectly.Steve Jonasson
ParticipantThank you Alex again, we’ve updated DFFS version to the latest. DateObject has started to work.
SteoSteve Jonasson
ParticipantYou’re a magician Alex, thank you, it works perfectly. I hope it will help other people someday.
Thanks.
SteoSteve Jonasson
ParticipantThank you, Alex, it helped me a lot.
In Czech, we have comma separator instead of a decimal dot.
And I changed the event from “keyup” to “change” and it works perfectly.
SteoSteve Jonasson
ParticipantOk, I hope it won’t be complicated and not delete all configuration.
I’ll let you know when I’m done.
It will probably take some time.
Thank you Alex,
Steo.Steve Jonasson
ParticipantSteve Jonasson
ParticipantSorry, the output does not show anything. I should have added the attachment.
Attachments:
Steve Jonasson
ParticipantThank you, Alex, so much.
It is not working:var due = spjs.utility.getDateFieldAsDateObject("objNaDate"); var todayAt0900 = new Date(); todayAt0900.setHours(9, 0, 0); if (due < todayAt0900) { jQuery("#part1").hide(); spjs.dffs.alert({ "title": "No access", "msg": "This item is locked because the due date has passed.", "ok": function () { location.href = location.href.split("EditForm.aspx").join("DispForm.aspx"); } }); }
Field Internal Name is OK. Developer console in Google Chrome does not show any errors.
Thank you.
SteoSteve Jonasson
ParticipantI don’t understand exactly what you mean. Do you want to lock ALL items in the list at 09:00, or only those that have a due date on that same day?
Only those that have a due date on that same day.
And if the item has a due date “today” – locking it at 09:00 should keep it locked permanently?
Yes, keep it locked permanently after “today” – 09:00.
Steo
Steve Jonasson
ParticipantWell, all columns have been set as “Number”. I set them as “one line of text” and it works out.
-
This reply was modified 1 year, 1 month ago by
Steve Jonasson.
Steve Jonasson
ParticipantThe last thing, I cannot save the “item”, because of the value, for example: “0.7“, but in Czech, we have the value with a decimal point (comma) “0,7“. Can you help me?
Otherwise, it works perfectly.Steo
Attachments:
Steve Jonasson
ParticipantThank you Alex for pointing out the errors.
Now, it works perfectly.
SteoSteve Jonasson
ParticipantHi Alex,
I tried that and it worked perfectly. Then I made “tot” read-only and customized the JS function and it also worked followed by your instructions. But I need to sum 5 columns summed in “tot” column. So I have created 5 columns. “sumAll” is a column where it adds up.Here is my code:
jQuery("#dffs__x0043_hK1000 input, #dffs__x0043_hK450 input,#dffs_RozStan50 input, #dffs__RozGrah60 input, #dffs_Vian350 input").on("keyup",function(){ var str = jQuery(this).val().replace( /[^0-9.]/g, "" ); jQuery(this).val(str); setFinalCost(); }); function setFinalCost(){ var a, b, c, d, e, f, aa, bb, cc, dd, ee, ff; a = Number($("#dffs__x0043_hK1000 input").val()); b = Number($("#dffs__x0043_hK450 input").val()); c = Number($("#dffs_RozStan50 input").val()); d = Number($("#dffs_RozGrah60 input").val()); e = Number($("#dffs_Vian350 input").val()); f = Number($("#dffs_sumAll input").val()); aa = !isNaN(a) ? a : 0; bb = !isNaN(b) ? b : 0; cc = !isNaN(c) ? c : 0; dd = !isNaN(d) ? c : 0; ee = !isNaN(e) ? c : 0; ff = !isNaN(f) ? c : 0; if(isNaN(a)){ alert("Number format error in \""+spjs.dffs.fieldData._x0043_hK1000.disp+"\""); } if(isNaN(b)){ alert("Number format error in \""+spjs.dffs.fieldData._x0043_hK450.disp+"\""); } if(isNaN(c)){ alert("Number format error in \""+spjs.dffs.fieldData.RozStan50.disp+"\""); } if(isNaN(d)){ alert("Number format error in \""+spjs.dffs.fieldData.RozGrah60.disp+"\""); } if(isNaN(e)){ alert("Number format error in \""+spjs.dffs.fieldData.Vian350.disp+"\""); } if(isNaN(f)){ alert("Number format error in \""+spjs.dffs.fieldData.sumAll.disp+"\""); } setFieldValue("Tot",aa+bb+cc+dd+ee+ff); setTimeout(function(){ $("input.fieldValueUpdated").removeClass("fieldValueUpdated"); },1000); }
Thank you in advance.
SteoSteve Jonasson
ParticipantThank you so much Alex, it helped me a lot.
Thank you
Steve -
AuthorPosts