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 2781
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.
-...
|
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...
|
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...
|
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. ...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |