Chris_Aub | Posts: 14

Problem getting correct date format

0 votes
Hi, This issue popped up in the last couple of weeks in our testing Sandbox environment. We've been using Text Anchors to configure all our signatures, so we have a FULLNAME block, and a corresponding Date signed that gets auto-populated on signature. In the past, the date format was always the GMT datetime format and that worked fine. Lately, it seems our date format is being forced to MMMM dd, yyyy . I tried overwriting the format, but nothing seems to work. Looking at the 11.25 release notes, I found this, but the opposite seems to be happening: PB-21327: Fixed an issue that prevented a document's Accepted and Confirmed dates from displaying a timestamp. Here's the code I use to set the field:
public override ESignLiveAPIObjects.Field prepareEsignField(eSignLive_Conventions__c convention) {
		                    
        ESignLiveAPIObjects.Field field = new ESignLiveAPIObjects.Field();
        field.subtype = convention.Signature_Sub_Type__c;
        field.type = convention.Signature_Type__c;
        field.extract = false;
        
        if(!String.isBlank(convention.Text_Binding__c)){
        	
        	field.binding = convention.Text_Binding__c;
        	field.value = 'yyyy-MM-dd';
            
        }
        
        field.extractAnchor = new ESignLiveAPIObjects.ExtractAnchor();
        field.extractAnchor.index = 0;
        field.extractAnchor.text = pdf.language == 'FR' ? convention.Text_FR__c : convention.Anchor_Text__c;
        field.extractAnchor.characterIndex = 0;
        field.extractAnchor.leftOffset = convention.Left__c.intValue();
        field.extractAnchor.topOffset = convention.Top__c.intValue();
        field.extractAnchor.width = convention.Anchor_Width__c.intValue();//Default 175;
        field.extractAnchor.height = convention.Anchor_Height__c.intValue();//Default 40;
        field.extractAnchor.anchorPoint = ESignLiveAPIObjects.AnchorPoint.TOPLEFT;

        return field;
        
    }

Here is the resulting JSON for the package after creation:
 "fields": [
                        {
                            "binding": "{approval.signed}",
                            "validation": null,
                            "id": "",
                            "page": 9,
                            "data": null,
                            "top": 491,
                            "subtype": "LABEL",
                            "extractAnchor": null,
                            "formattedValue": "May 02, 2019",
                            "left": 566,
                            "width": 125,
                            "height": 35,
                            "extract": false,
                            "type": "INPUT",
                            "value": "MMMM dd, yyyy",
                            "name": ""
                        },
                        {
                            "binding": null,
                            "validation": null,
                            "id": "",
                            "page": 9,
                            "data": null,
                            "top": 485,
                            "subtype": "FULLNAME",
                            "extractAnchor": null,
                            "formattedValue": "",
                            "left": 206,
                            "width": 176,
                            "height": 40,
                            "extract": false,
                            "type": "SIGNATURE",
                            "value": "",
                            "name": ""
                        }
                    ]

Approved Answer
Duo_Liang | Posts: 3776

Reply to: Problem getting correct date format

0 votes
Hi Chris_Aub, Date Field format was an account level setting so that it can't be set by field level code. This issue could because of the version release so that the environment default date field format got changed, which is off the top of my head. To recover your previous setting, you could send your request to our support at [email protected] and our support team would help you! Duo

Chris_Aub | Posts: 14

Reply to: Problem getting correct date format

0 votes
OneSpan support has updated the date format, and now it's displaying as intended. Thank you

Duo_Liang | Posts: 3776

Reply to: Problem getting correct date format

0 votes
Glad that it solved your problem! Just let us know if you have any other issues. :) Duo

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off