|
|
(11 intermediate revisions not shown) |
Line 1: |
Line 1: |
- | [[Team:KULeuven/Meeting_Reports | < return to notebook]]
| |
| | | |
- | Momentarily using for test environment... don't touch anything!
| |
- |
| |
- | <html>
| |
- | <script type="text/javascript">
| |
- | var ndate = url_ndate_retriever();
| |
- | document.write("<center>< yesterday--".link("https://2008.igem.org/Team:KULeuven/" + url_date(date_yesterday(ndate))));
| |
- | document.write("<br>");
| |
- | document.write("--tomorrow ></center>".link("https://2008.igem.org/Team:KULeuven/" + url_date(date_tomorrow(ndate))));
| |
- |
| |
- | function url_ndate_retriever() {
| |
- | var url_tokens = location.href.split("/");
| |
- | var url_date_token = url_tokens[url_tokens.length-1];
| |
- |
| |
- | var date_tokens = url_date_token.split("_");
| |
- | var day = date_tokens[0];
| |
- | var month = date_tokens[1];
| |
- | var year = date_tokens[2];
| |
- | // ndate stands for numeric date, it is the date represented in milliseconds, it is not of type Date!
| |
- | return Date.parse(day + ' ' + month + ', ' + year);
| |
- | }
| |
- |
| |
- | function date_yesterday(ndate) {
| |
- | ndate -= 86400*1000/2;
| |
- |
| |
- | var yesterday = new Date();
| |
- | yesterday.setTime(ndate);
| |
- |
| |
- | return yesterday;
| |
- | }
| |
- |
| |
- | function date_tomorrow(ndate) {
| |
- | ndate += 86400*1000;
| |
- |
| |
- | var tomorrow = new Date();
| |
- | tomorrow.setTime(ndate);
| |
- |
| |
- | return tomorrow;
| |
- | }
| |
- |
| |
- | function url_date(date) {
| |
- | var url = "https://2008.igem.org/Team:KULeuven/";
| |
- | url += date.getDate();
| |
- | url += '_';
| |
- | url += getMonthName(date.getMonth());
| |
- | url += '_';
| |
- | url += date.getFullYear();
| |
- |
| |
- | return url;
| |
- | }
| |
- |
| |
- | function getMonthName(month_index) {
| |
- | var mnames = new Array('January', 'February', 'March', 'April', 'May',
| |
- | 'June', 'July', 'August', 'September', 'October', 'November', 'December');
| |
- |
| |
- | return mnames[month_index];
| |
- | }
| |
- |
| |
- | function test() {
| |
- | hey.value = date_yesterday(url_ndate_retriever()).getMonth();
| |
- | }
| |
- | </script>
| |
- |
| |
- | <input type="text" name="hey"/>
| |
- | <input type="button" onClick="test()"/>
| |
- |
| |
- | <input type="text" name="day0"/>
| |
- | <input type="text" name="month0"/>
| |
- | <input type="text" name="year0"/>
| |
- |
| |
- | </html>
| |