I have a html file with javascript and am loading information into it with a xml file stored within sharepoint. I am having problems getting the dates to appear correctly, specifically, start date and due dates. -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-
<title>Timeline-WorkPrint</title>
-
<html>
-
<head>
-
<script src="https://sharepoint.global.lmco.com/sites/BSAGroup/BSATestSite/Shared%20Documents/Timeline%20Documents/timeline/api/timeline-api.js" type="text/javascript"></script>
-
<script src="date.js" type="text/javascript"></script>
-
<script>
-
var tl;
-
var eventSource = new Timeline.DefaultEventSource();
-
-
function openXMLfile(file)
-
{
-
if (document.implementation && document.implementation.createDocument)
-
{
-
xmlDoc = document.implementation.createDocument("", "", null);
-
}
-
else if (window.ActiveXObject)
-
{
-
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
-
xmlDoc.async="false";
-
}
-
else
-
{
-
alert('Your browser can\'t handle this script');
-
return;
-
}
-
xmlDoc.load(file);
-
return(xmlDoc);
-
}
-
-
function takeEventOut(url)
-
{
-
xmlDoc = openXMLfile(url);
-
var rows = xmlDoc.getElementsByTagName('z:row');
-
-
for (j=0;j<rows.length;j++)
-
{
-
//document.write(rows.item(j).getAttribute('ows_DueDate'));
-
// taking the event info from the xml
-
var dateEvent = Date.parseExact(rows.item(j).getAttribute('ows_DueDate'), "yyyy-dd-mm hh:mm:ss");
-
-
var title = rows.item(j).getAttribute('ows_LinkTitle');
-
var status = rows.item(j).getAttribute('ows_Status');
-
-
/*id,
-
start, end, latestStart, earliestEnd, instant,
-
text, description, image, link,
-
icon, color, textColor */
-
var color;
-
switch (status)
-
{
-
case "In Progress":
-
color = "yellow";
-
break
-
case "Not Started":
-
color = "red";
-
break
-
case "Completed":
-
color = "green";
-
break
-
default:
-
color = "black";
-
break
-
}
-
var evt = new Timeline.DefaultEventSource.Event(
-
dateEvent , //start
-
new Date(dateEvent).addDays(+2), //end
-
dateEvent ,//dateEvent.addMonths(1), //latestStart
-
new Date(dateEvent).addDays(+2) ,//dateEvent.addWeeks(1), //earliestEnd
-
true, //instant
-
title, //text
-
status, 0,0 ,0 ,color //description
-
);
-
// adding it to the source
-
//document.write(evt.getStart.toString);
-
eventSource.add(evt);
-
-
}
-
-
-
}
-
-
function onLoad()
-
{
-
takeEventOut("https://sharepoint.global.lmco.com/sites/BSAGroup/BSATestSite/_vti_bin/owssvr.dll?XMLDATA=1&List={C9DA434F-216F-4C7C-9D5E-A5AC72DBA45B}&View={8315210C-1A47-47B4-8BE3-B6271BC97E8B}&RowLimit=0&RootFolder");
1 2801 acoder 16,027
Recognized Expert Moderator MVP
I have a html file with javascript and am loading information into it with a xml file stored within sharepoint. I am having problems getting the dates to appear correctly, specifically, start date and due dates.
What problems? Do you get errors? It seems as if you've added methods to the Date object. It might help if you post the code in date.js
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Simon Harvey |
last post by:
Whato chaps,
I work (or am hoping to work! :) for a company that specialises in the
following:
- Localisation of media - including software, manuals, literature and
training material.
- Creating training material themselves in many langauges built to order.
The main thing I'm thinking about for the company is maybe a sort of content
|
by: Stumped and Confused |
last post by:
Hello,
I really, really, need some help here - I've spent hours trying to find a
solution.
In a nutshell, I'm trying to have a user input a value in form's
textfield. The value should then be assigned to a variable and output
using document.write.
(Note, there is no submit button or other form elements. Basically
|
by: mr_burns |
last post by:
hi there,
i would like a book that will explain concepts of javascript and dhtml
instead of, for example, ten tutorials on how to do specific things in
js or dhtml.
ideally a book thats can explain from the basics of javascript, to
more complex things such as dhtml and dom onto things like creating
javascript objects (if that is possible, but u get the idea). rather
than this is how you make a drop down menu tutorial; this is how you
|
by: sdonohue |
last post by:
I am not very good at DHTML, but I have a set of links that use DHTML and they work :)
But now the customer wants to have one of my DHTML links call a javascript function when it is clicked on. When I put it into DHTML, it treats everything between the " " like a constant. When I remove the quotes, it gives me an error.
One of the versions I have tried is:
DQM_rollover_image12 = "/images/nav_hospital.gif"
DQM_rollover_wh12 =...
|
by: AGH |
last post by:
I have an Intranet based on ASP.NET 2.0 using Webparts to give a
similar experience to Sharepoint. This development was made as
Sharepoint 2003 did not suit our needs and Sharepoint 2007 was not
ready.
Now that Sharepoint 2007 is ready (and being demo'd) I am getting
questions regarding features available in the new Sharepoint that we
do not currently have. I am reluctant to throw away the current
Intranet and replace it with...
| |
by: GaryDean |
last post by:
I was advised by a Microsoft speaker at a local .Net conference that
"SharePoint" had a lot to offer for asp.net developers. I've spent a few
hours hunting down links on Sharepoint Services in Server2003 and also
SharePoint Portal Server Product. Whenever I try to learn the details of
what the SharePoint services have to offer for asp.net developers all roads
lead to a video, recorded in 2003 that has to do with "asp.net" and
sharepoint....
|
by: Neil |
last post by:
What is Sharepoint, and should I care?
|
by: doublestack |
last post by:
Hi everyone,
I have a xml file that Simile Timeline uses to call events...Some of the events have links in them and I need to have those links open a new window. As it stands now the links replace the timeline. Simile Timeline uses DHTML and AJAX. Any suggestions?
Sample of code:
<data>
<event start="Jun 02 2008 09:00:00 GMT" end="Aug 02 2008 16:00:00 GMT" isDuration="true" title="Internship at LMC"...
|
by: ismailc |
last post by:
Good day, I need help.
I would like to Update a Sharepoint List (Document Library) Folders using Web Services with Javascript.
I have searched on Goggle but nothing that updates a document Library using UpdateListsItem method & with it being a clientside i need to pass NT Credentials to the List
Please provide code as I have to get this going & have no clue.
Please Assist
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |