Changeset 23409

Show
Ignore:
Timestamp:
07.12.2010 17:11:47 (9 years ago)
Author:
max
Message:

Moved a few function in from extra.dm to here

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/video-and-audio/trunk/src/web/script/document.js

    r19827 r23409  
    415415    xmlHttp.send(null); 
    416416  } 
     417 
     418   
     419   
     420   
     421  function displayDateTimeLocale(datetimebroadcasted)  
     422    { 
     423     var year = datetimebroadcasted.substr(0,4); 
     424     var month = datetimebroadcasted.substr(4,2); 
     425     var day = datetimebroadcasted.substr(6,2); 
     426     var hours = datetimebroadcasted.substr(8,2); 
     427     var minutes = datetimebroadcasted.substr(10,2); 
     428     var seconds = datetimebroadcasted.substr(12,2); 
     429     var date = new Date(year, month*1-1, day, hours, minutes, seconds) 
     430     document.write(date.toLocaleString()); 
     431    } 
     432     
     433    function displayRemainingDaysToKeep(datetimebroadcasted,daysToKeep) 
     434    { 
     435     var oneDayInMs = 1000*60*60*24; 
     436     var year = datetimebroadcasted.substr(0,4); 
     437     var month = datetimebroadcasted.substr(4,2); 
     438     var day = datetimebroadcasted.substr(6,2); 
     439     var displayString = ""; 
     440     var importedDate = new Date(year, month*1-1, day); 
     441     var nowDate = new Date(); 
     442     var endDate = new Date(year, month*1-1, day*1+daysToKeep); 
     443     var daysLeft = Math.ceil((endDate.getTime()-nowDate.getTime())/(oneDayInMs)); 
     444      
     445     if (daysLeft >= 1) 
     446        { displayString = "This video has " + daysLeft + " day(s) remaining before expiration."; } 
     447     else 
     448        { displayString = "This video has expired, it will be deleted very soon."; } 
     449      
     450     document.write(displayString); 
     451    }