1. jimmywiddle
  2. RO CSVI
  3. Friday, 10 June 2016
  4.  Subscribe via email
Hi, Im trying to import a created date and make it a 4 years in the past, im aware I have to use a replacment rule, but Ive been trying many different things but nothing is working so far.

Its not so much the replacement rule im having problems with thats straight forward find /2016 replace /2012 etc etc but its getting the data from my import file into this field im having issues with.

Id really appreciate it if could explain the process please, i have a date field in my csv import file, which is also being imported for other k2 fields.

Many thanks in advance!
Accepted Answer Pending Moderation
Hello Jimmy,
Hi, Im trying to import a created date and make it a 4 years in the past, im aware I have to use a replacment rule, but Ive been trying many different things but nothing is working so far.

Its not so much the replacement rule im having problems with thats straight forward find /2016 replace /2012 etc etc but its getting the data from my import file into this field im having issues with.

You cannot import a created date, it is automatically created and there is no control on it when a new item is added. It is the same when you add a new item from K2 interface, you dont have any option to enter a created date.

Id really appreciate it if could explain the process please, i have a date field in my csv import file, which is also being imported for other k2 fields.

What you can do is do a custom table export from k2 item table with id (primary key field as this is required for custom table import) and created fields, update the created field and import back using custom table import operation and of course you can add more field to this import and export if needed.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi,Thanks again!
You cannot import a created date, it is automatically created and there is no control on it when a new item is added. It is the same when you add a new item from K2 interface, you dont have any option to enter a created date.


Within the available k2 fields there is a 'created'. Currently I have created column on the import but its importing no data, therefore setting the date to 29/11/-0001 - 23:58.

Also with k2 administration you can modify this creation date when creating or editing the k2 item.

But you cannot change data for this field on the import? Im wondering why its in the list?

Also I found this post which suggests using this method editing the created date, which he says works: http://stackoverflow.com/questions/10997836/joomla-k2-how-to-order-items-by-extra-field-date?source=1



Basically I am simply trying to order items by a date field/column in my import file, surely this is very basic/common request and cannot be so complex?

Once again, many thanks!
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Jimmy,

But you cannot change data for this field on the import? Im wondering why its in the list?
It's in the list because CSVI reads all the fieldnames it finds in the database.

surely this is very basic/common request and cannot be so complex?
The request is not complex but also not common :)

I have no problem adding this as a feature although it should be possible to import the created date for existing items, just not for new items.

The created date format is 2015-21-31 23:59:59.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi Roland,

Thanks again for your help/response!

Yes this would be wonderful if you could add it as an feature, its now pretty much the only thing I need to complete this job.

Currently I have the date in this format 31/12/2016 with no time, but I guess I can change that with a replacement rule or 2.

Really appreciate this Roland (adding this as a feature)! I hope this doesn't come across in the wrong way but how soon do you think you could have it ready?

Thanks again!
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello JImmy,

how soon do you think you could have it ready?
Attached is the patch file you can load via the maintenance menu.

This makes the created date available for import and the format must be day/month/year or day-month-year.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Great many thanks, it works perfect, once again amazing support and component!!!
  1. more than a month ago
  2. RO CSVI
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!