<commit_before>'use strict';

// Custom OC things used across views

var $ = require( 'jquery' );
var t = require( 'translator' ).t;

function addSignedStatus( form ) {
    var $status;
    var metaPlus = '/*/' /* + model.getNamespacePrefix( 'http://openrosa.org/xforms' ) + ':'*/ +
        'meta/' + form.model.getNamespacePrefix( 'http://openclinica.org/xforms' ) + ':';
    var signedBy = form.model.evaluate( metaPlus + 'signedBy', 'string' );
    var signedOn = form.model.evaluate( metaPlus + 'signedOn', 'string' );

    if ( signedBy && signedOn ) {
        $status = $( '<div class="record-signed-status">' + t( 'signed.msg', {
                name: signedBy,
                date: _parseDateTime( signedOn )
            } ) +
            '</div>' );
        $( '#form-title' )
            .before( $status )
            .closest( 'form.or' ).on( 'valuechange.enketo inputupdate.enketo', function() {
                $status.remove();
            } );
    }
}

function _parseDateTime( dt ) {
    var parts = ( dt ) ? dt.substr( 0, dt.indexOf( ' ' ) ).split( '-' ) : [];
    return parts.length === 3 ? parts[ 1 ] + '/' + parts[ 2 ] + ', ' + parts[ 0 ] : 'error';
}

module.exports = {
    addSignedStatus: addSignedStatus
};<commit_msg>changed: OC: show timestamp value of signed status as provided without parsing,<commit_after>'use strict';

// Custom OC things used across views

var $ = require( 'jquery' );
var t = require( 'translator' ).t;

function addSignedStatus( form ) {
    var $status;
    var metaPlus = '/*/' /* + model.getNamespacePrefix( 'http://openrosa.org/xforms' ) + ':'*/ +
        'meta/' + form.model.getNamespacePrefix( 'http://openclinica.org/xforms' ) + ':';
    var signedBy = form.model.evaluate( metaPlus + 'signedBy', 'string' );
    var signedOn = form.model.evaluate( metaPlus + 'signedOn', 'string' );

    if ( signedBy && signedOn ) {
        $status = $( '<div class="record-signed-status">' + t( 'signed.msg', {
                name: signedBy,
                date: signedOn
            } ) +
            '</div>' );
        $( '#form-title' )
            .before( $status )
            .closest( 'form.or' ).on( 'valuechange.enketo inputupdate.enketo', function() {
                $status.remove();
            } );
    }
}


module.exports = {
    addSignedStatus: addSignedStatus
};
{'fraction_non_alphanumeric': 0.17687366167023555, 'fraction_numerical': 0.0021413276231263384, 'mean_word_length': 2.3134751773049644, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3372710', 'n_tokens_mistral': 755, 'n_tokens_neox': 730, 'n_words': 164}