private void RegisterJavascript()
{
// Get current date format and make sure it has double-lower-case month and day designators for the js date picker to use
var dateFormat = System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern;
dateFormat = dateFormat.Replace( "M", "m" ).Replace( "m", "mm" ).Replace( "mmmm", "mm" );
dateFormat = dateFormat.Replace( "d", "dd" ).Replace( "dddd", "dd" );
var script = string.Format( @"Rock.controls.dateTimePicker.initialize({{ id: '{0}', startView: {1}, format: '{2}', todayHighlight: {3} }});",
this.ClientID, this.StartView.ConvertToInt(), dateFormat, this.HighlightToday.ToString().ToLower() );
ScriptManager.RegisterStartupScript( this, this.GetType(), "datetime_picker-" + this.ClientID, script, true );
}