full_calendar change am/pm to 24 hours - fullcalendar

In the agenda week options on the left side - there is that am/pm I want to remove/replace that with just 01:00, 02:00 so on.
check out that example and switch to the week view - on the left side you will find 6am, 7am etc...
fiddle
Thanks for your time.

I downloaded the language pack from here
and then I've added this:
lang: "de",
to the full_calendar js code.

Set the timeFormat option
timeFormat: 'H(:mm)'
TimeFormat Docs

Related

bootstrap-datepicker shows the wrong month (month select)

I'm using the bootstrap-datepicker and I'm running in to this weird issue.
it works fine, but when I selects a month (E.g May) it shows the selected month as March. (2 months back), Always there is a 2 months gap between,
What is in the date select and months shown in the date-picker popup.
My date-picker is set to only show months and it starts from 1 Jan 2018,
and following is the config
var date = new Date('January 1, 2018');
$('.datepicker').datepicker({
format: "MM yyyy",
minViewMode: 'months',
autoclose: true,
startDate: date
});
What seems to be going wrong here ?
$('.datepicker').datepicker({
format: "MM yyyy",
viewMode: "months",
minViewMode: "months",
startDate: new Date('Jan 1, 2018')});
Try this out. This might help you
Although this might not help for your specific scenario, I did run into the same issue when I included the time.
So format of dd/mm/yyyy was doing fine but once I switched to dd/mm/yyyy hh:mm it added 2 months (December instead of October).
All I eventually had to do was switch to the format dd/mm/yyyy hh:ii as shown in the documentation.
That saved me from switching to a newer version (which is still old when looking at it now, but the github project of datetimepicker points to that link).

report builder 3.0 date timestamp expression

I have a report that uses the folowing expression in a date timestamp field to format the date as either US format or European format depending on a Language prompt the user selects:
=iif(Parameters!LANG.Value = "EN", ToDateTime(Fields!TRANS_DATE.Value).ToString("MM/dd/yyyy"), ToDateTime(Fields!TRANS_DATE.Value).ToString("dd-MM-yyyy"))
If he user selects English, April 1st appears as 04/01/16. If they select any other format, the date appears as 01-04-16. Works great.
I would like to do the same thing on another field but I would like to leave the time in the results. So, if the user selects English, the results would display 04-01-16 11:15:23 AM. Otherwise, I would like to see 01-04-16 11:15:23 AM.
Can I modify the expression above to do the same thing but leave the hours and minutes and seconds in the result?
Thanks for your help.......
You need to append this to your datetime format string:
"hh:mm:ss tt"
So in your case:
=iif(Parameters!LANG.Value = "EN", ToDateTime(Fields!TRANS_DATE.Value).ToString("MM/dd/yyyy hh:mm:ss tt"), ToDateTime(Fields!TRANS_DATE.Value).ToString("dd-MM-yyyy hh:mm:ss tt"))

ASP.NET "String was not recognized as a valid DateTime."

First off, I realize there's a million pages discussing this already. I have looked at least a hundred of them but cannot seem to make this work. My date and time is presented as a string, compiled from javascript to grab client's local time. It is formatted like this: 7/11/2015 8:34 PM.
I currently have:
Dim datetimeformated = DateTime.ParseExact(lblDateTime.Text, "MM/dd/yyyy HH:mm tt", CultureInfo.InvariantCulture)
I have tried many different variants, but this should be correct I think, yet it does not work. Any help is greatly appreciated. TIA
The correct format for your case is: M/dd/yyyy h:mm tt, and perhaps even, M/d/yyyy h:mm tt, if you can have the day of the month as a single digit.
Explanation: Why your format string didn't work.
MM: means that you must always have 2 digits for the month, clearly not the case in your example.
dd: again, means that you must always have 2 digits for the day of the month. Is that the case? Adjust the parameter if needed.
HH: This actually means that you are expecting the hour value as 2-digits using the 24-hour clock (00-23), which is clearly wrong on both accounts. You can have a single digit, and you are not using the 24-hour clock, because you are using the AM/PM designator.
Relevant documentation link: Custom Date and Time Format Strings.

Moment.js first day of the week incorrect

I'm working with Moment.js for my first time. I tried to retrieve the date of the first day of the week, and in Europe this is normally Monday. Whatever I do, I get Sunday as result of the first day of the week.
I tried to set-up different languages (local or globally), but to no avail. I use the langs.min.js file from the moment.js github page. The language file of "en-gb" and "fr" has the line of code:
dow : 1, // Monday is the first day of the week.
So I would get the date of monday when I ask for the first day of the week right? I keep getting Sunday as output.
// Create moment object
var localLang = moment();
// Set language to french
localLang.lang('fr');
// Test language
localLang.lang(); // Output: fr
// Retrieve first day of the week and format it
var dow = localLang.startOf('week').format('dddd DD-MM-YYYY'); // Output: dimanche 14-04-2013
Dimanche is french for Sunday.. As you see, moment.js can use the language file succesfully but doesn't use the day of the week configuration
JSfiddle with moment.js and langs.js to test:
JSFiddle
edit:
I can get the date of Monday instead of Sunday with day(1) instead of startOf('week'). But using day(0)I still get Sunday as a result. Why isn't monday the first day of the week, as configured in the language files.
For anyone who come across this question lately, moment now support lang method to set locale specific setting.
Setting first week to be Monday:
moment.lang('zh-cn', {
week : {
dow : 1 // Monday is the first day of the week
}
});
var date = moment().weekday(0); // date now is the first day of the week, (i.e., Monday)
We are working on adding locale aware weekdays, but it hasn't been finished yet.
https://github.com/timrwood/moment/issues/613#issuecomment-13786429

How do I format time in SSRS to HH:MM AM/PM format?

I was tasked with augmenting the following code to display the time without seconds, and with AM/PM:
=IIF(Fields!New_Date.Value <> "NO CHANGE", FormatDateTime(IIF(Fields!New_Date.Value = "NO CHANGE","1/1/12",Fields!New_Date.Value),DateFormat.ShortDate), "") &
IIF(Fields!New_Time.Value <> "NO CHANGE",FormatDateTime(IIF(Fields!New_Time.Value = "NO CHANGE","00:00",Fields!New_Time.Value),DateFormat.ShortTime), "")
In realizing that FormatDateTime was insufficient for what I was trying to do, I found the following did not work (just looking at the snippit that relates to the time fields), :
Format(IIF(Fields!New_Time.Value = "NO CHANGE","00:00",Fields!New_Time.Value),"HH:mm tt")
Or this
Format(IIF(Fields!New_Time.Value = "NO CHANGE","00:00",Fields!New_Time.Value),"HH:MM tt")
I'm getting the format codes from here.
What am I doing wrong?
So I found that because I was essentially trying to format a textbox, SSRS never really 'knew' that it was a time field. While I'm not 100% sure my reasoning is correct, it does explain why the following works:
Format(CDate(IIF(Fields!New_Time.Value = "NO CHANGE","00:00",Fields!New_Time.Value)),"hh:mm tt")
If your data is in simple textbox(or table cell) you have easer solution.
right click on the textbox > properties :
use the following:
The other answers are correct, but the key difference to know with the format is:
h:mm tt --> 12-hour clock (e.g. 5:30 PM)
hh:mm tt --> 12-hour clock with a leading zero, if necessary (e.g. 05:30 PM)
H:mm --> 24-hour clock (e.g. 1:30 for 1:30 AM)
HH:mm --> 24-hour clock with a leading zero, if necessary (e.g. 01:30 for 1:30 AM)
From Text Box Properties -> Number -> Custom Category:
Try to input this:
dd-MMM-yy hh:mm tt

Resources