How do I get rid of whitespace when rendering without touching template indentations? I have the following code.

{% spaceless %}
{% for date in entry.d_date %}
    {% if date.showMonth == 1 %}
    {{ date.date.month }}-
    {% endif %}
    {% if date.showDate == 1 %}
    {{ date.date.day }}-
    {% endif %}
    {{ date.date.year }}
{% endfor %}
{% endspaceless %}


Which outputs 1- 1- 2014

Is there anyway to get rid of the whitespace without touching the indentation? I've used {spaceless} but it's not working.
The spaceless tag only removes whitespace between HTML tags. You have to use the whitespace control modifier on your tags to remove leading and or trailing whitespace.

Additionally I'd use the ternary operator for your conditionals (and put the hyphen inside it):

{% for date in entry.d_date %}
    {{  date.showMonth == 1 ? date.date.month ~ '-' : '' -}}
    {{- date.showDate == 1 ? date.date.day ~ '-' : '' -}}
    {{- date.date.year }}
{% endfor %}