That was my solution.
In the DateRange.ascx
<%
DateTime fromDate = MonatSession.HistoryFromDate;
DateTime toDate = MonatSession.HistoryToDate;
string dateTimeFormat = "{0:" + MonatSession.CurrentCustomer.Preferences["Date Format"].ToString() + " H:mm:ss}";
string dateFormat = MonatSession.CurrentCustomer.Preferences["Date Format"].ToString().ToUpper();
// Date and Time Format for OV Preference
//string[] prefArray = MonatSession.CurrentCustomer.Preferences.Values.ToArray();
//string prefDate = prefArray[0].ToLower();
//string prefTime = prefArray[1];
string prefDate = MonatSession.CurrentCustomer.Preferences["Date Format"].ToLower();
string prefTime = MonatSession.CurrentCustomer.Preferences["Time Format"];
if (prefTime.Contains("tt"))
prefTime = prefTime.Replace("tt", "A");
if (prefTime.Contains("mm"))
prefTime = prefTime.Replace("mm", "ii");
%>
in the javaScript datePicker:
<script type="text/javascript">
var popLocation = '<%=Request.Browser.IsMobileDevice ? "bottom" : "center"%>';
$(document).ready(function () {
var prefDate = '<%= prefDate %>';
//var dFormat = prefDate.replace("yyyy", "yy");
var dFormat = prefDate.replace("yyyy", "yyyy");
var tFormat = '<%= prefTime %>';
//New dates pulled from values passed at top of file
let from = new Date("<%=fromDate%>");
let to = new Date("<%=toDate%>");
$('#datePickMobi').mobiscroll().datepicker({
theme: 'ios',
controls: ['calendar', 'time'],
select: 'range',
display: popLocation,
defaultSelection: [from, to],
dateFormat: dFormat.toUpperCase(),
//timeFormat: tFormat,
startInput: '#Mobi_startDate',
endInput: '#Mobi_endDate',
onChange: function (event, inst) {
var Dates = inst.getVal();
var startDate = Dates[0];
var endDate = Dates[1];
setSessionDates(startDate, endDate);
//$('#Mobi_startDate').val(moment(inst._tempStartText).format('<%=dateFormat%>'));
//$('#Mobi_endDate').val(moment(inst._tempEndText).format('<%=dateFormat%>'));
}
});
});
Thanks.