Setting Date Format with Javascript

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Setting Date Format with Javascript

Post by prime clinical systems »

Hi, Since I could not figure out how to handle date in sdk, I found that with Javascript I can get the Category of Date, and the Format string to show, but I cannot make the dropdown for the field become visible.
FN = "Text1" for example
JS = "var f = this.getField(""" & FN & """); f.setAction(""Format"",""AFDate_FormatEx(\""mm/dd/yyyy\"");"");"
Call Me.PDF.Inst.ExecuteJS(Me.PDF.Doc, JS, PAEC_Field, PAESC_Exec, Nothing, Result)
JS = "var f = this.getField(""" & FN & """); f.setAction(""Keystroke"",""AFDate_KeystrokeEx(\""mm/dd/yyyy\"");"");"
Call Me.PDF.Inst.ExecuteJS(Me.PDF.Doc, JS, PAEC_Field, PAESC_Exec, Nothing, Result)
Dim FField As IPXC_FormField
Set FField = Me.PDF.Doc.CoreDoc.AcroForm.GetFieldByName(FN)
FField.Flags = TFF_Date
Call Me.PDF.Doc.FireFieldChangedEvent(FField)
the formatting works, but no dropdown shows, any solution for that?
ce
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Setting Date Format with Javascript

Post by Sasha - Tracker Dev Team »

Hello Clifford,

Just spoke with our lead dev. - he said that this can be done only with JS and that this is a bug on our side that drop-down is not shown and he will try to fix this until the next release.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Setting Date Format with Javascript

Post by prime clinical systems »

Ok thanks
ce
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Setting Date Format with Javascript

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: Setting Date Format with Javascript

Post by prime clinical systems »

Hi was this fixed in the 322.5 release of Jun 29?
ce
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Setting Date Format with Javascript

Post by Tracker Supp-Stefan »

Hello Clifford,

Sasha told me that this is planned for build 323, as far as he is aware.

Cheers,
Stefan
Post Reply