Sha256: 218fc3d2e862ef2ed32757b05931d679d0342d0499f40bcc89c4264e051fa458

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

var weekdays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

function fdts(y,m,d,hr,mn,s) {
  gmtDate = new Date(Date.UTC(y,m-1,d,hr,mn,s));
	text = months[gmtDate.getMonth()];
  text += ' '+gmtDate.getDate();
  ampm = 'AM';
  hours = gmtDate.getHours();
  if (hours > 11) { ampm = 'PM'; }
  if (hours == 0) { hours = 12; }
  if (hours > 12) { hours -= 12; }
  text += ' '+hours;
  minutes = gmtDate.getMinutes();
  if (minutes < 10) { minutes = '0'+minutes; }
  text += ':'+minutes;
  seconds = gmtDate.getSeconds();
  if (seconds < 10) { seconds = '0'+seconds; }
  text += ':'+seconds;
  text += ' '+ampm;
  document.write(text);
}
function fdt(y,m,d,hr,mn,s) {
  gmtDate = new Date(Date.UTC(y,m-1,d,hr,mn,s));
	text = months[gmtDate.getMonth()];
  text += ' '+gmtDate.getDate();
  ampm = 'AM';
  hours = gmtDate.getHours();
  if (hours > 11) { ampm = 'PM'; }
  if (hours == 0) { hours = 12; }
  if (hours > 12) { hours -= 12; }
  text += ' '+hours;
  minutes = gmtDate.getMinutes();
  if (minutes < 10) { minutes = '0'+minutes; }
  text += ':'+minutes;
  text += ' '+ampm;
  document.write(text);
}
function fd(y,m,d,hr,mn,s) {
  gmtDate = new Date(Date.UTC(y,m-1,d,hr,mn,s));
  text = months[gmtDate.getMonth()];
  text += ' '+gmtDate.getDate();
  document.write(text);
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ryanlowe-client_date-0.1.1 public/javascripts/client_date.js