Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2324
  • Last Modified:

Sharepoint Calendar View on custom list - CEWP to hide time?

so I want to create a calendar view for a custom list. I only have a date only field.
the calendar displays 12:00 AM (really Sharepoint??)

So I would like to hide the stupid 12:00 am from displaying.

Can I do that by adding code (jquery, css, whatever) to a CEWP at the bottom of the page?
0
sullisnyc44
Asked:
sullisnyc44
1 Solution
 
nsyyoungCommented:
I seem to be on calculated column issues today.  Can you calculate a column to trim away the time and use that column in your calendar view?  Will it show up as a date?

Worth a try, anyway.  Someone probably has a better answer.
0
 
sullisnyc44Author Commented:
no. I just use date only feature of a date-time column.

I'm not adverse to adding a bunch of unnecessary display columns to my forms/views and then just hiding them with jquery, I just don't think the calendar view will allow me to select it as a the manadatory Start Date and End Date and thus not solve my time issue.

can't I add some sort of 'display:none' atrribute to a cewp?
0
 
nsyyoungCommented:
Just to clarify, you want to show a calendar grid in a CEWP?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
sullisnyc44Author Commented:
No.

i would like to hide/delete/destroy the 12:00AM from displaying in my standard calendar view of my custom list with a Date Only column.

Can it be suppressed with a CEWP?
0
 
dp_expertCommented:
Sullisnyc44

SharePoint shows the hour because it always stores the hour in the "Date" column - the "Date only" or "Date and time" switch is only for the presentation layer - it turns off the hour and minute pickers on the add/edit form and hides the hours on the views and view item page. If you export the data to excel or access or turn on the hours you can see theat there is going to be 12:00 in the column. I guess MS guys forgot to hide it on the monthly view and  did an even worse job on the week nad day view, where such events are displayed as 1 hour events at 12:00 AM.

CEWP does not enable you to modify or generate calendar views. You can do a workaround with javascript and hide the hour.
i;m assuiming you are using the monthly view. f so use SPD to open the page with the view, and at the bottom of the page add a javascript code that will hide the time.
Unfortunatelly the time is not in a specific tag or style, so you need to do a loop through TD's with "ms-cal-monthitem" class and inside each such tag find anchor tag (<A>) and then remove the first occurance of the <NoBR> tag - this is where the hour is hidden.

If you need a code snippet let me know.
0
 
sullisnyc44Author Commented:
a code snippet would be lovely. Thanks :)
0
 
Shinesh PremrajanCommented:
Look a the view source and see whats the 12:00 AM is in.
Something like
<div id="time"> 12:00AM</div>

In the css that ist using u need to add the additional css to hide this as

#time{display:none};

Also you can add this script  specific to a single page instead by pasting the above code.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now