Skip to content

Instantly share code, notes, and snippets.

@JKetelaar
Created April 16, 2018 19:32
Show Gist options
  • Save JKetelaar/a8932bda78175ae1c503353d593469d5 to your computer and use it in GitHub Desktop.
Save JKetelaar/a8932bda78175ae1c503353d593469d5 to your computer and use it in GitHub Desktop.
{% for appointment in appointments %}
{% if appointment.inactive %}
var color = '#FF0000';
{% else %}
var color = '#' + ({{ appointment.user.id / 25000 }} * 0xFFFFFF << 0).toString(16);
{% endif %}
events.push(
{
id: '{{ appointment.id }}',
//TODO: Find way to display - D: {{ appointment.dentist }} - H: {{ appointment.hygienist }} - C: {{ appointment.user.name }} cleanly in title
title: '{{ appointment.type }} - {{ appointment.user.name }}',
start: '{{ appointment.start|date('Y-m-dTH:i') }}',
end: '{{ appointment.end|date('Y-m-dTH:i') }}',
dentist: '{{ appointment.dentist.name }}',
hygienist: '{{ appointment.hygienist.name }}',
user: '{{ appointment.user.name }}',
color: color
}
);
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment